?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "鎖住和解鎖數據庫"
ClientHeight = 3690
ClientLeft = 60
ClientTop = 345
ClientWidth = 4530
LinkTopic = "Form1"
ScaleHeight = 3690
ScaleWidth = 4530
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "取消鎖定"
Height = 450
Left = 2805
TabIndex = 4
Top = 1185
Width = 1320
End
Begin VB.CommandButton Command2
Caption = "鎖定"
Height = 450
Left = 2805
TabIndex = 3
Top = 630
Width = 1320
End
Begin VB.ListBox List1
Height = 2400
Left = 225
TabIndex = 1
Top = 375
Width = 2100
End
Begin VB.CommandButton Command1
Caption = "退出"
Height = 450
Left = 2790
TabIndex = 0
Top = 2625
Width = 1320
End
Begin VB.Label Label2
Height = 825
Left = 195
TabIndex = 5
Top = 2820
Width = 2145
End
Begin VB.Label Label1
Caption = "數據庫列表"
Height = 330
Left = 300
TabIndex = 2
Top = 75
Width = 2010
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database
Dim tb As TableDef
Private Sub Form_Load()
Set db = OpenDatabase(App.Path & "\sj.mdb", False, False, ";pwd=111")
For Each tb In db.TableDefs
If Left(tb.Name, 4) <> "MSys" Then List1.AddItem (tb.Name)
Next
List1.Refresh
End Sub
Private Sub Command2_Click()
db.TableDefs(List1.Text).ValidationRule = "True=False"
db.TableDefs(List1.Text).ValidationText = "This table locked via " & "ValidationRule on " & Now
Label2.Caption = List1.Text & " 已被鎖定,您將無法修改數據!"
End Sub
Private Sub Command3_Click()
db.TableDefs(List1.Text).ValidationRule = ""
db.TableDefs(List1.Text).ValidationText = ""
Label2.Caption = List1.Text & " 已解除鎖定,您可以修改數據! "
End Sub
Private Sub List1_Click()
If db.TableDefs(List1.Text).ValidationRule = "True=False" Then
Label2.Caption = List1.Text & " 是被鎖定的表"
Else
Label2.Caption = List1.Text & " 表沒被鎖定"
End If
End Sub
Private Sub Command1_Click()
End
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -