📄 select_inputdb.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Select_InputDB
BorderStyle = 1 'Fixed Single
Caption = "选择导入的数据库"
ClientHeight = 1425
ClientLeft = 45
ClientTop = 435
ClientWidth = 3510
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1425
ScaleWidth = 3510
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdChoose
Caption = "选"
Height = 375
Left = 3000
TabIndex = 4
Top = 480
Width = 375
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 600
Top = 720
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 2760
TabIndex = 3
Top = 960
Width = 615
End
Begin VB.CommandButton cmdOK
Caption = "确认"
Height = 375
Left = 2160
TabIndex = 2
Top = 960
Width = 615
End
Begin VB.TextBox Db_Name
Height = 375
Left = 120
Locked = -1 'True
TabIndex = 1
Top = 480
Width = 2775
End
Begin VB.Label Label1
Caption = "请选择需要导入的数据库:"
Height = 255
Left = 120
TabIndex = 0
Top = 120
Width = 2295
End
End
Attribute VB_Name = "Select_InputDB"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private FilePath As String
Private Fs As New FileSystemObject
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdChoose_Click()
Call OpenFile
Db_Name.Text = CommonDialog1.FileTitle
End Sub
Private Sub cmdOK_Click()
If Fs.FileExists(App.Path & "\indata\InDB.mdb") Then
Fs.DeleteFile (App.Path & "\indata\InDB.mdb")
End If
If Right(Db_Name.Text, 3) <> "mdb" Then
MsgBox "不是合法的MDB数据库文件", vbExclamation, "警告"
Exit Sub
End If
Fs.CopyFile FilePath, App.Path & "\indata\"
Name App.Path & "\indata\" & Db_Name.Text As App.Path & "\indata\InDB.mdb"
MsgBox "数据库成功拷贝,可以进行数据处理操作", vbInformation, "信息提示"
Unload Me
End Sub
'打开文件
Private Sub OpenFile()
CommonDialog1.ShowOpen
On Error GoTo err
FilePath = CommonDialog1.FileName
Exit Sub
err:
MsgBox "没有选定的文件,请重试", vbInformation, "信息提示"
End Sub
Private Sub Form_Load()
CommonDialog1.Filter = "数据库文件(*.mdb)|*.mdb|所有文件(*.*)|*.*"
End Sub
Private Sub Form_Unload(Cancel As Integer)
MDIForm1.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -