?? 查詢圖書.frm
字號:
VERSION 5.00
Begin VB.Form form4
Caption = "Form1"
ClientHeight = 3150
ClientLeft = 5175
ClientTop = 2370
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3150
ScaleWidth = 4680
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3240
TabIndex = 4
Top = 2520
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 495
Left = 1800
TabIndex = 3
Top = 2520
Width = 1095
End
Begin VB.Frame 查詢
Caption = "查詢圖書信息"
ForeColor = &H00FF0000&
Height = 2175
Left = 480
TabIndex = 0
Top = 240
Width = 3735
Begin VB.TextBox Text2
Height = 375
Left = 1200
TabIndex = 2
Top = 840
Width = 1935
End
Begin VB.Label Label2
Caption = "輸入書號"
Height = 375
Left = 240
TabIndex = 1
Top = 960
Width = 975
End
End
End
Attribute VB_Name = "form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim note As New ADODB.Recordset
Private Sub Command1_Click()
Dim sql As String
sql = "select * from 書庫表 where 書號='" & Trim(Text2.Text) & "'"
note.Open sql, cnn, 3, 2
If note.EOF And note.BOF Then
MsgBox "查找失敗!!無此類書!"
note.Close
Text2.Text = ""
Else
form7.Show
On Error Resume Next '有錯誤也強制執行
note.MoveFirst
If Err.Number <> 0 Then Exit Sub '如果有錯則退出
Do While Not note.EOF '循環直到記錄集的末尾
form7.MSFlexGrid1.AddItem (Empty) '將記錄集合的數據輸出到MSFLEXGRID控件
form7.MSFlexGrid1.Row = form7.MSFlexGrid1.Rows - 2
form7.MSFlexGrid1.Col = 0
form7.MSFlexGrid1.Text = Trim(note.Fields("書號").Value)
form7.MSFlexGrid1.Col = 1
form7.MSFlexGrid1.Text = Trim(note.Fields("書名").Value)
form7.MSFlexGrid1.Col = 2
form7.MSFlexGrid1.Text = note.Fields("作者").Value
form7.MSFlexGrid1.Col = 3
form7.MSFlexGrid1.Text = Trim(note.Fields("定價").Value)
form7.MSFlexGrid1.Col = 4
form7.MSFlexGrid1.Text = note.Fields("出版社編號").Value
form7.MSFlexGrid1.Col = 5
form7.MSFlexGrid1.Text = note.Fields("數量").Value
form7.MSFlexGrid1.Col = 6
form7.MSFlexGrid1.Text = note.Fields("類別").Value
note.MoveNext
Loop
Set note = Nothing '釋放連接
form7.MSFlexGrid1.RemoveItem form7.MSFlexGrid1.Rows - 1
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -