📄 form1.ebf
字号:
VERSION 5.00
Object = "{A32A88B3-817C-11D1-A762-00AA0044064C}#1.0#0"; "mscecomdlg.dll"
Object = "{25C953A7-5464-11D1-A714-00AA0044064C}#1.0#0"; "MSCEFILE.DLL"
Begin VB.Form Form1
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "Form1"
ClientHeight = 4605
ClientLeft = 60
ClientTop = 840
ClientWidth = 4200
ForeColor = &H80000008&
ScaleHeight = 4605
ScaleWidth = 4200
ShowOK = -1 'True
Begin FILECTLCtl.FileSystem FileSystem1
Left = 2280
Top = 2880
_cx = 2200
_cy = 1400
End
Begin CEComDlgCtl.CommonDialog CommonDialog1
Left = 1320
Top = 2880
_cx = 847
_cy = 847
CancelError = 0 'False
Color = 0
DefaultExt = ""
DialogTitle = ""
FileName = ""
Filter = ""
FilterIndex = 0
Flags = 0
HelpCommand = 0
HelpContext = ""
HelpFile = ""
InitDir = ""
MaxFileSize = 256
FontBold = 0 'False
FontItalic = 0 'False
FontName = ""
FontSize = 10
FontUnderline = 0 'False
Max = 0
Min = 0
FontStrikethru = 0 'False
End
Begin VBCE.CommandButton Command2
Height = 495
Left = 1800
TabIndex = 4
Top = 1800
Width = 1335
_cx = 2355
_cy = 873
BackColor = 12632256
Caption = "取消"
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Style = 0
End
Begin VBCE.CommandButton but_deldb
Height = 495
Left = 240
TabIndex = 3
Top = 1800
Width = 1215
_cx = 2143
_cy = 873
BackColor = 12632256
Caption = "删除数据库"
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Style = 0
End
Begin VBCE.Label Label1
Height = 375
Left = 0
TabIndex = 2
Top = 0
Width = 975
_cx = 1720
_cy = 661
AutoSize = 0 'False
BackColor = -2147483643
BackStyle = 1
BorderStyle = 0
Caption = "数据库名称"
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = -2147483640
Alignment = 0
UseMnemonic = -1 'True
WordWrap = 0 'False
End
Begin VBCE.ComboBox cb_dbname_del
Height = 300
Left = 1080
TabIndex = 1
Top = 0
Width = 1575
List = "Form1.frx":0000
ItemData = "Form1.frx":0028
_cx = 2778
_cy = 529
BackColor = -2147483643
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = -2147483640
Text = ""
IntegralHeight = -1 'True
Locked = 0 'False
Sorted = 0 'False
Style = 0
End
Begin VBCE.CommandButton but_searchdb
Height = 375
Left = 2760
TabIndex = 0
Top = 0
Width = 735
_cx = 1296
_cy = 661
BackColor = 12632256
Caption = "........"
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Style = 0
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim table, indextable As ADOCE.Recordset
Private Sub but_deldb_Click()
If Len(Trim(cb_dbname_del.Text)) = 0 Then
MsgBox "请输入当前数据库路径及名称", vbOKOnly, "提示"
Exit Sub
ElseIf FileSystem1.Dir(Trim(cb_dbname_del.Text)) = "" Then
MsgBox "数据库不存在,请确认", vbOKOnly, "提示"
cb_dbname_del.Text = ""
Exit Sub
End If
Dim delyesno As Integer
Dim sql As String
sql = "DROP DATABASE '" & cb_dbname_del.Text & "'"
delyesno = MsgBox("是否删除数据库?", vbOKCancel, "提示")
If delyesno = vbOK Then
table.Open sql
If Err.Number > 0 Then
MsgBox "删除失败", vbOKOnly, "提示"
Else
MsgBox "删除成功", vbOKOnly, "提示"
cb_dbname_del.Text = ""
End If
End If
End Sub
Private Sub but_searchdb_Click()
CommonDialog1.Filter = "Pocket Access (*.cdb) | *.cdb"
CommonDialog1.ShowOpen
cb_dbname_del.Text = CommonDialog1.FileName
End Sub
Private Sub Form_Load()
Set table = CreateObject("ADOCE.Recordset.3.1")
End Sub
Private Sub Form_OKClick()
App.End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -