📄 frmdaoru.frm
字号:
VERSION 5.00
Begin VB.Form frmdaoru
BorderStyle = 1 'Fixed Single
ClientHeight = 5325
ClientLeft = 45
ClientTop = 330
ClientWidth = 9810
Icon = "frmdaoru.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5325
ScaleWidth = 9810
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "数据导入"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 4935
Left = 120
TabIndex = 0
Top = 120
Width = 9375
Begin VB.TextBox Text1
Height = 375
Left = 360
TabIndex = 6
Text = "Text1"
Top = 360
Width = 3615
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 360
TabIndex = 5
Top = 1080
Width = 3615
End
Begin VB.DirListBox Dir1
Height = 2400
Left = 360
TabIndex = 4
Top = 1800
Width = 3615
End
Begin VB.FileListBox File1
Height = 3870
Left = 4080
Pattern = "dbdb*.mdb"
TabIndex = 3
Top = 360
Width = 2415
End
Begin VB.CommandButton Command1
Caption = "导入"
BeginProperty Font
Name = "黑体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 6840
TabIndex = 2
Top = 600
Width = 1695
End
Begin VB.CommandButton Command2
Caption = "返回"
BeginProperty Font
Name = "黑体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 6840
TabIndex = 1
Top = 2520
Width = 1695
End
End
End
Attribute VB_Name = "frmdaoru"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo errhandle:
Dim a As String
a = App.Path
a = a & "\"
b = Text1.Text
Dim filename As String
If Dir("" & a & "计费系统数据库.mdb") <> "" Then
Dim ll As String
ll = MsgBox("此目录下有此文件要覆盖吗", vbYesNo, "复制文件")
If ll = vbYes Then
Kill ("" & a & "计费系统数据库.mdb")
FileCopy "" & Text1.Text & "", "" & a & "计费系统数据库.mdb"
Dim l
l = MsgBox("数据导入成功", vbOKOnly, "提示")
Else
Exit Sub
End If
Else
FileCopy "" & Text1.Text & "", "" & a & "计费系统数据库.mdb"
Dim llp
llp = MsgBox("数据导入成功", vbOKOnly, "提示")
End If
Exit Sub
errhandle:
MsgBox "出现错误,不能复制", vbOKOnly + vbCritical, "复制文件"
End Sub
Private Sub Command2_Click()
dy
Unload Me
End Sub
Private Sub Dir1_Change()
If Right(Dir1.Path, 1) <> "\" Then
Text1.Text = Dir1.Path + "\"
Else
Text1.Text = Dir1.Path
End If
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
If Drive1.Drive = "a:" Then
MsgBox "不能从A盘导入"
Exit Sub
End If
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
Text1.Text = Text1.Text + File1.filename
Command1.Enabled = True
End Sub
Private Sub Form_Activate()
gCnn.Close
Command1.Enabled = False
'Text1.Text = "c:\"
Text1.Text = CurDir()
Text1.Enabled = False
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
dy
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
If gCnn.State = 0 Then
gCnn.ConnectionString = cnn
gCnn.CursorLocation = adUseClient
gCnn.Open
End If
MDIme.loadAdd
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -