form1.frm
来自「vb数据库编程资料」· FRM 代码 · 共 78 行
FRM
78 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2055
ClientLeft = 60
ClientTop = 450
ClientWidth = 4335
LinkTopic = "Form1"
ScaleHeight = 2055
ScaleWidth = 4335
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 375
Left = 3120
TabIndex = 4
Text = "Text1"
Top = 0
Width = 735
End
Begin VB.CommandButton Command1
Caption = "删除"
Height = 375
Left = 2280
TabIndex = 1
Top = 960
Width = 1815
End
Begin VB.ListBox List1
Height = 1320
Left = 360
TabIndex = 0
Top = 480
Width = 1455
End
Begin VB.Label Label2
Caption = "表数:"
Height = 255
Left = 2280
TabIndex = 3
Top = 120
Width = 615
End
Begin VB.Label Label1
Caption = "教学数据库中的表"
Height = 255
Left = 360
TabIndex = 2
Top = 120
Width = 1695
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim CurDir As String
Dim jxdb As Database
Dim biao As TableDef
Private Sub Command1_Click()
jxdb.TableDefs.Delete List1.Text '删除选定的表
Call DispTableName '调用DispTableName重新显示表名和表的数目
End Sub
Private Sub Form_Load()
Set jxdb = DBEngine.Workspaces(0).OpenDatabase(App.Path & "\教学") '打开数据库
Call DispTableName '调用DispTableName显示表名和表的数目
End Sub
Private Sub DispTableName()
List1.Clear '清除掉列表框中的列表项
With jxdb
For Each biao In .TableDefs
List1.AddItem biao.Name '把表名添加到列表框中
Next biao
Text1.Text = .TableDefs.Count '把表的数量显示在文本框中
End With
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?