?? chushihua_data.frm
字號:
VERSION 5.00
Begin VB.Form ChuShiHua_data
Caption = "初始化數(shù)據(jù)庫"
ClientHeight = 3390
ClientLeft = 60
ClientTop = 345
ClientWidth = 4830
LinkTopic = "Form1"
ScaleHeight = 3390
ScaleWidth = 4830
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame5
Caption = "清除庫存數(shù)據(jù)庫"
Height = 975
Left = 2040
TabIndex = 2
Top = 0
Width = 2775
Begin VB.CommandButton Command2
Caption = "清 除"
Height = 375
Left = 600
TabIndex = 4
Top = 360
Width = 1335
End
End
Begin VB.Frame Frame2
Caption = "清除數(shù)據(jù)庫"
Height = 2295
Left = 0
TabIndex = 1
Top = 1080
Width = 4815
Begin VB.CommandButton Command6
Caption = "退 出"
Height = 375
Left = 2520
TabIndex = 22
Top = 1680
Width = 1815
End
Begin VB.CommandButton Command5
Caption = "清除零售數(shù)據(jù)庫"
Height = 375
Left = 2520
TabIndex = 21
Top = 1200
Width = 1815
End
Begin VB.CommandButton Command4
Caption = "清除批發(fā)數(shù)據(jù)庫"
Height = 375
Left = 360
TabIndex = 20
Top = 1680
Width = 1815
End
Begin VB.CommandButton Command3
Caption = "清除進(jìn)貨數(shù)據(jù)庫"
Height = 375
Left = 360
TabIndex = 19
Top = 1200
Width = 1815
End
Begin VB.ComboBox Combo2
Height = 300
Left = 1080
TabIndex = 10
Text = "Combo2"
Top = 240
Width = 735
End
Begin VB.ComboBox Combo3
Height = 300
Left = 2040
TabIndex = 9
Text = "Combo3"
Top = 240
Width = 615
End
Begin VB.ComboBox Combo4
Height = 300
Left = 2880
TabIndex = 8
Text = "Combo4"
Top = 240
Width = 615
End
Begin VB.ComboBox Combo5
Height = 300
Left = 1080
TabIndex = 7
Text = "Combo5"
Top = 720
Width = 735
End
Begin VB.ComboBox Combo6
Height = 300
Left = 2040
TabIndex = 6
Text = "Combo6"
Top = 720
Width = 615
End
Begin VB.ComboBox Combo7
Height = 300
Left = 2880
TabIndex = 5
Text = "Combo7"
Top = 720
Width = 615
End
Begin VB.Label Label1
Caption = "日"
Height = 255
Left = 3480
TabIndex = 18
Top = 720
Width = 255
End
Begin VB.Label Label2
Caption = "日期范圍:"
Height = 255
Left = 120
TabIndex = 17
Top = 240
Width = 975
End
Begin VB.Label Label3
Caption = "年"
Height = 255
Left = 1800
TabIndex = 16
Top = 360
Width = 255
End
Begin VB.Label Label4
Caption = "月"
Height = 255
Left = 2640
TabIndex = 15
Top = 360
Width = 255
End
Begin VB.Label Label5
Caption = "日"
Height = 255
Left = 3480
TabIndex = 14
Top = 360
Width = 255
End
Begin VB.Label Label6
Caption = "年"
Height = 255
Left = 1800
TabIndex = 13
Top = 840
Width = 255
End
Begin VB.Label Label7
Caption = "月"
Height = 255
Left = 2640
TabIndex = 12
Top = 840
Width = 255
End
Begin VB.Label Label9
Caption = "至"
ForeColor = &H00FF0000&
Height = 255
Left = 840
TabIndex = 11
Top = 600
Width = 255
End
End
Begin VB.Frame Frame1
Caption = "清除藥品數(shù)據(jù)庫"
Height = 975
Left = 0
TabIndex = 0
Top = 0
Width = 1935
Begin VB.CommandButton Command1
Caption = "清 除"
Height = 375
Left = 480
TabIndex = 3
Top = 360
Width = 1095
End
End
End
Attribute VB_Name = "ChuShiHua_data"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Trecordset As New ADODB.Recordset
Private Sub Command1_Click()
If MsgBox("您確實清除藥品基礎(chǔ)數(shù)據(jù)嗎?如果操作,藥品基礎(chǔ)數(shù)據(jù)需要重新輸入!", vbYesNo + vbInformation, "提示") = vbYes Then
If Trecordset.State = 1 Then Trecordset.Close
With Trecordset
Set .ActiveConnection = SGWConnection
.CursorLocation = adUseServer
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Source = "Select * from yaopin"
.Open
End With
If Trecordset.RecordCount <= 0 Then Exit Sub: Trecordset.Close
Trecordset.MoveFirst
For i = 0 To Trecordset.RecordCount - 1
Trecordset.Delete
Trecordset.MoveNext
Next i
MsgBox "藥品基礎(chǔ)數(shù)據(jù)庫已清除完畢!", vbOKOnly + vbInformation, "提示"
End If
Trecordset.Close
End Sub
Private Sub Command2_Click()
If MsgBox("您確實清除庫存數(shù)據(jù)嗎?如果操作,庫存數(shù)據(jù)將不能恢復(fù)!", vbYesNo + vbInformation, "提示") = vbYes Then
If Trecordset.State = 1 Then Trecordset.Close
With Trecordset
Set .ActiveConnection = SGWConnection
.CursorLocation = adUseServer
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Source = "Select * from kucun"
.Open
End With
If Trecordset.RecordCount <= 0 Then Exit Sub: Trecordset.Close
Trecordset.MoveFirst
For i = 0 To Trecordset.RecordCount - 1
Trecordset.Delete
Trecordset.MoveNext
Next i
MsgBox "庫存數(shù)據(jù)庫已清除完畢!", vbOKOnly + vbInformation, "提示"
End If
Trecordset.Close
End Sub
Private Sub Command3_Click()
If MsgBox("您確實清除進(jìn)貨數(shù)據(jù)嗎?如果操作,進(jìn)貨數(shù)據(jù)將不能恢復(fù)!", vbYesNo + vbInformation, "提示") = vbYes Then
If Trecordset.State = 1 Then Trecordset.Close
With Trecordset
Set .ActiveConnection = SGWConnection
.CursorLocation = adUseServer
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Source = "Select * from jinhuo where shijian>=cdate('" & Trim(Combo2.Text) & "-" & Trim(Combo3.Text) & "-" & Trim(Combo4.Text) & "') and shijian<=cdate('" & Trim(Combo5.Text) & "-" & Trim(Combo6.Text) & "-" & Trim(Combo7.Text) & "')"
.Open
End With
If Trecordset.RecordCount <= 0 Then Exit Sub: Trecordset.Close
Trecordset.MoveFirst
For i = 0 To Trecordset.RecordCount - 1
Trecordset.Delete
Trecordset.MoveNext
Next i
MsgBox "進(jìn)貨數(shù)據(jù)庫已清除完畢!", vbOKOnly + vbInformation, "提示"
End If
Trecordset.Close
End Sub
Private Sub Command4_Click()
If MsgBox("您確實清除批發(fā)數(shù)據(jù)嗎?如果操作,批發(fā)數(shù)據(jù)將不能恢復(fù)!", vbYesNo + vbInformation, "提示") = vbYes Then
If Trecordset.State = 1 Then Trecordset.Close
With Trecordset
Set .ActiveConnection = SGWConnection
.CursorLocation = adUseServer
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Source = "Select * from pifa where shijian>=cdate('" & Trim(Combo2.Text) & "-" & Trim(Combo3.Text) & "-" & Trim(Combo4.Text) & "') and shijian<=cdate('" & Trim(Combo5.Text) & "-" & Trim(Combo6.Text) & "-" & Trim(Combo7.Text) & "')"
.Open
End With
If Trecordset.RecordCount <= 0 Then Exit Sub: Trecordset.Close
Trecordset.MoveFirst
For i = 0 To Trecordset.RecordCount - 1
Trecordset.Delete
Trecordset.MoveNext
Next i
MsgBox "批發(fā)數(shù)據(jù)庫已清除完畢!", vbOKOnly + vbInformation, "提示"
End If
Trecordset.Close
End Sub
Private Sub Command5_Click()
If MsgBox("您確實清除零售數(shù)據(jù)嗎?如果操作,零售數(shù)據(jù)將不能恢復(fù)!", vbYesNo + vbInformation, "提示") = vbYes Then
If Trecordset.State = 1 Then Trecordset.Close
With Trecordset
Set .ActiveConnection = SGWConnection
.CursorLocation = adUseServer
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Source = "Select * from lingshou where shijian>=cdate('" & Trim(Combo2.Text) & "-" & Trim(Combo3.Text) & "-" & Trim(Combo4.Text) & "') and shijian<=cdate('" & Trim(Combo5.Text) & "-" & Trim(Combo6.Text) & "-" & Trim(Combo7.Text) & "')"
.Open
End With
If Trecordset.RecordCount <= 0 Then Exit Sub: Trecordset.Close
Trecordset.MoveFirst
For i = 0 To Trecordset.RecordCount - 1
Trecordset.Delete
Trecordset.MoveNext
Next i
MsgBox "零售數(shù)據(jù)庫已清除完畢!", vbOKOnly + vbInformation, "提示"
End If
Trecordset.Close
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub Form_Load()
'set the window in the middle
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
'init the combobox
Combo2.Clear
Combo3.Clear
Combo4.Clear
Combo5.Clear
Combo6.Clear
Combo7.Clear
For i = 1980 To Year(Date)
Combo2.AddItem i
Combo5.AddItem i
Next
Combo2.Text = Year(Date) - 1
Combo5.Text = Year(Date)
For i = 1 To 12
Combo3.AddItem i
Combo6.AddItem i
Next
Combo3.Text = Month(Date)
Combo6.Text = Month(Date)
For i = 1 To 31
Combo4.AddItem i
Combo7.AddItem i
Next
Combo4.Text = Day(Date)
Combo7.Text = Day(Date)
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -