?? borrow.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form borrow
BackColor = &H80000000&
Caption = "讀者借書窗口"
ClientHeight = 3195
ClientLeft = 5700
ClientTop = 1410
ClientWidth = 4680
Icon = "borrow.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
Begin MSAdodcLib.Adodc Adodc0
Height = 330
Left = -480
Top = 0
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數(shù)據(jù)庫;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數(shù)據(jù)庫;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "圖書借閱表"
Caption = "Adodc4"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton cancel
Caption = "取消"
Height = 375
Left = 2760
TabIndex = 6
Top = 2640
Width = 975
End
Begin VB.CommandButton ok
Caption = "確定"
Height = 375
Left = 720
TabIndex = 5
Top = 2640
Width = 975
End
Begin VB.TextBox uid
Height = 375
Left = 1320
TabIndex = 4
Top = 1920
Width = 1815
End
Begin MSAdodcLib.Adodc Adodc3
Height = 330
Left = -480
Top = 2160
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數(shù)據(jù)庫;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數(shù)據(jù)庫;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select 圖書編號 from 圖書基本信息表"
Caption = "Adodc3"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataListLib.DataCombo DataCombo3
Bindings = "borrow.frx":324A
Height = 315
Left = 1320
TabIndex = 3
Top = 1320
Width = 1815
_ExtentX = 3201
_ExtentY = 582
_Version = 393216
Style = 2
ListField = "圖書編號"
Text = ""
End
Begin MSDataListLib.DataCombo DataCombo2
Bindings = "borrow.frx":325F
Height = 315
Left = 2040
TabIndex = 2
Top = 600
Width = 2535
_ExtentX = 4471
_ExtentY = 582
_Version = 393216
Style = 2
ListField = "書名"
Text = ""
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = -480
Top = 1680
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數(shù)據(jù)庫;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數(shù)據(jù)庫;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select 書名 from 圖書基本信息表"
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = -480
Top = 1200
Visible = 0 'False
Width = 1215
_ExtentX = 2143
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數(shù)據(jù)庫;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數(shù)據(jù)庫;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "圖書種類表"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "borrow.frx":3274
DataField = "圖書種類"
DataSource = "Adodc1"
Height = 315
Left = 120
TabIndex = 1
Top = 600
Width = 1695
_ExtentX = 2990
_ExtentY = 582
_Version = 393216
Style = 2
ListField = "圖書種類"
Text = ""
End
Begin VB.Label Label4
BackColor = &H80000000&
Caption = "讀者編號"
Height = 375
Left = 480
TabIndex = 9
Top = 1920
Width = 1215
End
Begin VB.Label Label3
BackColor = &H80000000&
Caption = "圖書編號"
Height = 375
Left = 480
TabIndex = 8
Top = 1320
Width = 1215
End
Begin VB.Label Label2
BackColor = &H80000000&
Caption = "書名"
Height = 375
Left = 3120
TabIndex = 7
Top = 360
Width = 1215
End
Begin VB.Label Label1
BackColor = &H80000000&
Caption = "圖書種類"
Height = 375
Left = 720
TabIndex = 0
Top = 360
Width = 1215
End
End
Attribute VB_Name = "borrow"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset
Dim str As String
Private Sub Form_Activate()
Adodc0.Refresh
End Sub
Private Sub back_Click()
Unload Me
End Sub
Private Sub cancel_Click()
Unload Me
End Sub
Private Sub datacombo1_gotfocus()
DataCombo2.Text = ""
DataCombo3.Text = ""
End Sub
Private Sub datacombo1_lostfocus()
If DataCombo1.Text <> "" Then
Adodc2.RecordSource = "select 書名 from 圖書基本信息表 where 圖書種類 ='" & LTrim(DataCombo1.Text) & "'" & " and 是否在庫='1'"
Adodc2.Refresh
End If
DataCombo2.Enabled = True
End Sub
Private Sub datacombo2_gotfocus()
DataCombo3.Text = ""
If Trim(DataCombo1.Text) = "" Then
MsgBox "先從 ‘圖書種類’ 中選擇一個種類", vbOKOnly + vbExclamation, "信息提示"
DataCombo2.Enabled = False
End If
DataCombo3.Enabled = True
End Sub
Private Sub datacombo2_lostfocus()
If Trim(DataCombo2.Text) <> "" Then
Adodc3.RecordSource = "select 圖書編號 from 圖書基本信息表 where 書名='" & Trim(DataCombo2.Text) & "'"
Adodc3.Refresh
End If
End Sub
Private Sub datacombo3_gotfocus()
If Trim(DataCombo1.Text) = "" Then
MsgBox "先從 ‘圖書種類’ 中選擇一個種類", vbOKOnly + vbExclamation, "信息提示"
DataCombo2.Text = ""
DataCombo2.Enabled = False
DataCombo3.Text = ""
DataCombo3.Enabled = False
End If
If Trim(DataCombo2.Text) = "" Then
MsgBox "先從 ‘書名’ 中選擇一本書", vbOKOnly + vbExclamation, "信息提示"
DataCombo3.Text = ""
DataCombo3.Enabled = False
End If
End Sub
Private Sub ok_Click()
If Trim(DataCombo2.Text) = "" Then
MsgBox "先從 ‘書名’ 中選擇一本書", vbOKOnly + vbExclamation, "信息提示"
DataCombo3.Text = ""
DataCombo3.Enabled = False
End If
If Trim(DataCombo3.Text) = "" Then
MsgBox "先從 ‘圖書編號中選取編號’ 中選擇一本書", vbOKOnly + vbExclamation, "信息提示"
End If
str = "select * from 查閱者基本信息表 where 讀者編號='" & Trim(uid.Text) & "'"
Set rs = exesql(str)
If Trim(uid.Text) = "" Then
MsgBox "請輸入讀者編碼.例:0113325", vbOKOnly + vbExclamation, "信息提示"
uid.SetFocus
Exit Sub
ElseIf rs.RecordCount = 0 Then
MsgBox "無此用戶,請重試!", vbOKOnly + vbExclamation, "信息提示"
uid.Text = ""
uid.SetFocus
Exit Sub
End If
'str = "borrow '" & Trim(DataCombo3.Text) & "'"
'Set rs = exesql(str)
str = "select * from 圖書借閱表 where getdate()-借書日期>30 and 讀者編號 = '" & Trim(uid.Text) & "'"
Set rs = exesql(str)
If rs.RecordCount <> 0 Then
MsgBox "請先還過期未還書,不能借書!", vbOKOnly + vbExclamation, "信息提示"
Else
borrow.Adodc0.Recordset.AddNew
borrow.Adodc0.Recordset.Fields("圖書編號") = Trim(DataCombo3.Text)
borrow.Adodc0.Recordset.Fields("書名") = Trim(DataCombo2.Text)
borrow.Adodc0.Recordset.Fields("讀者編號") = Trim(uid.Text)
borrow.Adodc0.Recordset.Fields("借書日期") = Now
borrow.Adodc0.Recordset.Update
borrow.Adodc0.Refresh
str = "update 圖書基本信息表 set 是否在庫 ='0' where 圖書編號='" & Trim(DataCombo3.Text) & "'"
exesql (str)
MsgBox "借閱成功!", vbOKOnly + vbExclamation, "信息提示"
DataCombo3.Text = ""
DataCombo2.Text = ""
DataCombo1.Text = ""
uid.Text = ""
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -