?? form1.frm
字號:
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form Form1
Caption = "部分或全部清除數據庫數據"
ClientHeight = 3750
ClientLeft = 60
ClientTop = 345
ClientWidth = 8610
LinkTopic = "Form1"
ScaleHeight = 3750
ScaleWidth = 8610
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command3
Caption = "退出"
Height = 360
Left = 6975
TabIndex = 3
Top = 3330
Width = 1575
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "E:\明日vb編程500例\數據庫\清空數據庫\mrlc.mdb"
DefaultCursorType= 0 '缺省游標
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 420
Left = 45
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "kc"
Top = 3270
Visible = 0 'False
Width = 1635
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "Form1.frx":0000
Height = 3165
Left = 75
OleObjectBlob = "Form1.frx":0014
TabIndex = 2
Top = 75
Width = 8475
End
Begin VB.CommandButton Command1
Caption = "清空庫存為零的"
Height = 360
Left = 3690
TabIndex = 0
Top = 3330
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "全部清空"
Height = 360
Left = 5340
TabIndex = 1
Top = 3330
Width = 1575
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim db As Database
Set db = Workspaces(0).OpenDatabase(App.Path & "\mrlc.mdb")
Dim sql As String
sql = "delete * from kc where kc.庫存=0"
db.Execute sql
Data1.Refresh
End Sub
Private Sub Command2_Click()
Dim db As Database
Set db = Workspaces(0).OpenDatabase(App.Path & "\mrlc.mdb")
Dim sql As String
sql = "delete * from kc "
db.Execute sql
Data1.Refresh
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -