📄 frmbookfind.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form Frmbookfind
Caption = "图书信息查询"
ClientHeight = 4095
ClientLeft = 60
ClientTop = 465
ClientWidth = 7530
LinkTopic = "Form1"
ScaleHeight = 4095
ScaleWidth = 7530
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "返 回"
Height = 444
Left = 5880
TabIndex = 5
Top = 960
Width = 1095
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 1815
Left = 120
TabIndex = 3
Top = 1800
Width = 7215
_ExtentX = 12726
_ExtentY = 3201
_Version = 393216
End
Begin VB.CommandButton Command1
Caption = "搜 索"
Enabled = 0 'False
Height = 444
Left = 4440
TabIndex = 2
Top = 960
Width = 1095
End
Begin VB.TextBox Text1
Height = 375
Left = 1560
TabIndex = 1
Top = 960
Width = 2535
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Frmbookfind.frx":0000
Left = 1560
List = "Frmbookfind.frx":0010
TabIndex = 0
Top = 480
Width = 1335
End
Begin VB.Frame Frame1
Caption = "查 询"
Height = 1455
Left = 240
TabIndex = 4
Top = 120
Width = 6975
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "输入关键字:"
Height = 255
Left = 240
TabIndex = 7
Top = 840
Width = 1095
End
Begin VB.Label Label1
Caption = "选择查询类别:"
Height = 255
Left = 120
TabIndex = 6
Top = 360
Width = 1455
End
End
End
Attribute VB_Name = "Frmbookfind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Sqltxt As String
Dim x As Integer
Private Sub Command1_Click()
Dim j As Integer
For j = 1 To x
For i = 0 To 5
Me.MSFlexGrid1.TextMatrix(j, i) = ""
Next i
Next j
x = 1
Open_book_message
Do While cnn.EOF = False
'Sqltxt = cnn.Fields(k).Value
'If Sqltxt = "fgh" Then
'For j = 0 To 3
Find
'cnn.MoveNext
If cnn.EOF = True Then
Exit Sub
End If
If Trim(Sqltxt) = Trim(Text1.Text) Then
For i = 0 To 4
Me.MSFlexGrid1.TextMatrix(x, i) = Trim(cnn.Fields(i).Value)
'Me.MSFlexGrid1.TextMatrix(X, i) = " " & cnn.Fields(i).Value & """"
Next i
Me.MSFlexGrid1.TextMatrix(x, 5) = Trim(cnn.Fields(9).Value)
x = x + 1
End If
cnn.MoveNext
If cnn.EOF = True Then
Exit Sub
End If
'cnn.MoveNext
'Next j
'End If
'cnn.MoveNext
Loop
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
x = 1
MSFlexGrid1.Rows = 15
MSFlexGrid1.Cols = 6
Me.MSFlexGrid1.TextMatrix(0, 0) = "书籍编号"
MSFlexGrid1.ColWidth(0) = 942
Me.MSFlexGrid1.TextMatrix(0, 1) = "书籍名称"
MSFlexGrid1.ColWidth(1) = 1142
Me.MSFlexGrid1.TextMatrix(0, 2) = "类别"
MSFlexGrid1.ColWidth(2) = 1242
MSFlexGrid1.ColWidth(3) = 1000
Me.MSFlexGrid1.TextMatrix(0, 3) = "作者"
MSFlexGrid1.ColWidth(4) = 1588
Me.MSFlexGrid1.TextMatrix(0, 4) = "出版社"
Me.MSFlexGrid1.TextMatrix(0, 5) = "是否可借"
End Sub
Public Sub Find()
Dim id As String
Dim i, x As Integer
If Combo1.Text = "书籍编号" Then
'Sqltxt = "select * from book_message where book_id =" & " '" & Text1.Text & "'"
'Set cnn = st.Execute(Sqltxt)
Sqltxt = cnn.Fields(0).Value
End If
If Combo1.Text = "书籍名称" Then
'Sqltxt = "select * from book_message where book_name =" & " '" & Text1.Text & "'"
'Set cnn = st.Execute(Sqltxt)
Sqltxt = cnn.Fields(1).Value
End If
If Combo1.Text = "类别" Then
'Sqltxt = "select * from book_message where book_type =" & " '" & Text1.Text & "'"
'Set cnn = st.Execute(Sqltxt)
Sqltxt = cnn.Fields(2).Value
End If
If Combo1.Text = "作者" Then
'Sqltxt = "select * from book_message where book_author =" & " '" & Text1.Text & "'"
'Set cnn = st.Execute(Sqltxt)
Sqltxt = cnn.Fields(3).Value
End If
End Sub
Private Sub Text1_Change()
If Text1.Text = "" Then
Command1.Enabled = False
Else
Command1.Enabled = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -