?? form2.frm
字號:
VERSION 5.00
Begin VB.Form Form2
Caption = "借書"
ClientHeight = 4920
ClientLeft = 60
ClientTop = 345
ClientWidth = 4590
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4920
ScaleWidth = 4590
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text4
DataField = "還書日期"
DataSource = "Data1"
Height = 270
Left = 1440
TabIndex = 15
Top = 3120
Width = 1695
End
Begin VB.Data Data1
Connect = "Access"
DatabaseName = "C:\My Documents\畢業(yè)設計2\libary.mdb"
DefaultCursorType= 0 '缺省游標
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 240
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "libary"
Top = 4320
Width = 4140
End
Begin VB.TextBox Text3
DataField = "借書日期"
DataSource = "Data1"
Height = 270
Left = 1440
TabIndex = 14
Top = 2640
Width = 1695
End
Begin VB.TextBox Text11
Height = 270
Left = 3240
TabIndex = 13
Top = 2640
Width = 735
End
Begin VB.TextBox Text12
Height = 270
Left = 3240
TabIndex = 12
Top = 3120
Width = 735
End
Begin VB.TextBox Text13
Height = 270
Left = 3240
TabIndex = 11
Text = "傳遞查詢變量"
Top = 3480
Width = 735
End
Begin VB.TextBox Text5
DataField = "書籍名稱"
DataSource = "Data1"
Height = 270
Left = 1440
TabIndex = 10
Top = 3480
Width = 1695
End
Begin VB.TextBox Text6
DataField = "書籍介紹"
DataSource = "Data1"
Height = 270
Left = 1440
TabIndex = 9
Top = 3840
Width = 1695
End
Begin VB.Frame Frame1
Caption = "借書"
Height = 1215
Left = 240
TabIndex = 4
Top = 360
Width = 4095
Begin VB.TextBox Text15
Height = 270
Left = 960
TabIndex = 25
Top = 720
Width = 2655
End
Begin VB.TextBox Text10
Height = 270
Left = 960
TabIndex = 24
Text = "Text10"
Top = 720
Width = 2655
End
Begin VB.TextBox Text7
Height = 270
Left = 960
TabIndex = 23
Text = "Text7"
Top = 720
Width = 2655
End
Begin VB.TextBox Text14
Height = 270
Left = 960
TabIndex = 22
Top = 360
Width = 2655
End
Begin VB.TextBox Text9
Height = 270
Left = 960
TabIndex = 21
Text = "Text7"
Top = 360
Width = 2655
End
Begin VB.TextBox Text8
Height = 270
Left = 960
TabIndex = 20
Text = "Text7"
Top = 360
Width = 2655
End
Begin VB.TextBox Text1
Height = 270
Left = 960
TabIndex = 6
Top = 360
Width = 2655
End
Begin VB.TextBox Text2
Height = 270
Left = 960
TabIndex = 5
Top = 720
Width = 2655
End
Begin VB.Label Label3
Caption = "學號:"
Height = 255
Left = 240
TabIndex = 8
Top = 360
Width = 615
End
Begin VB.Label Label4
Caption = "書號:"
Height = 255
Left = 240
TabIndex = 7
Top = 720
Width = 615
End
End
Begin VB.CommandButton Command1
Caption = "續(xù)借"
Height = 375
Left = 600
TabIndex = 3
Top = 1920
Width = 855
End
Begin VB.CommandButton Command2
Caption = "備注"
Height = 375
Left = 1440
TabIndex = 2
Top = 1920
Width = 855
End
Begin VB.CommandButton Command3
Caption = "取消"
Height = 375
Left = 2280
TabIndex = 1
Top = 1920
Width = 855
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Left = 3120
TabIndex = 0
Top = 1920
Width = 855
End
Begin VB.Label Label1
Caption = "借書日期"
Height = 255
Left = 600
TabIndex = 19
Top = 2640
Width = 735
End
Begin VB.Label Label2
Caption = "借書日期"
Height = 255
Left = 600
TabIndex = 18
Top = 3120
Width = 735
End
Begin VB.Label Label5
Caption = "備注名稱"
Height = 255
Left = 600
TabIndex = 17
Top = 3480
Width = 735
End
Begin VB.Label Label6
Caption = "備注內容"
Height = 615
Left = 600
TabIndex = 16
Top = 3840
Width = 735
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'由于把借書和還書操作成在一個窗體上,共動用了15個text控件,可以用全局變量來代替,為了方便我選擇了前者
'text1與data1的學號綁定
'text2與data1的書號綁定
'text3與data1的借書日期綁定
'text4與data1的還書日期綁定
'text5與data1的書籍名稱綁定
'text6與data1的書籍介紹綁定
'text7用來傳遞借書時輸入的學號
'text8用來傳遞借書時的書號
'text9用來傳遞還書時的書號
'text10用來確認還書時的書號
'text11用來傳遞借書時的借書日期,與text3對應
'text12用來傳遞借書時的還書日期,與text4對應
'text13用來傳遞還書者的學號,以便查詢顯示該學號所借的所有書籍
'text14用來傳遞借書時備注的書名,與text5對應
'text15用來傳遞借書時備注的介紹,與text6對應
Private Sub Bor_Click()
On Error GoTo wrong
If Text10 = "" Then
MsgBox "請輸入書號!", 16
Exit Sub
End If
If Text9 = "" Then
MsgBox "請輸入學號", 16
Exit Sub
End If
ssql = "select * from S_no where 學號='" & Text9.Text & "'" '查詢學號是否存在,不存在則退出過程
Set user_me = cn.Execute(ssql)
If user_me.EOF Then
MsgBox "學號不存在,無借書權限", 16
Exit Sub
End If
ssql = "select * from libary where 書號='" & Text10.Text & "'" '查詢書是否已借出
Set user_me = cn.Execute(ssql)
If Not user_me.EOF Then
MsgBox "此書已借出,請確認輸入是否正確", 16
Exit Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -