?? retbk.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 retbk
BackColor = &H80000000&
Caption = "讀者還書"
ClientHeight = 3225
ClientLeft = 4920
ClientTop = 1800
ClientWidth = 4755
Icon = "retbk.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3225
ScaleWidth = 4755
Begin MSAdodcLib.Adodc Adodc3
Height = 375
Left = -360
Top = 1920
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 661
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=圖書管理數據庫;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數據庫;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 MSAdodcLib.Adodc Adodc2
Height = 330
Left = -360
Top = 1440
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=圖書管理數據庫;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數據庫;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select 書名 from 圖書借閱表 where 還書日期 is null"
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 VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3360
TabIndex = 6
Top = 2520
Width = 975
End
Begin VB.CommandButton Command1
Caption = "還書"
Height = 375
Left = 360
TabIndex = 5
Top = 2520
Width = 975
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = -360
Top = 960
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
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=圖書管理數據庫;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=圖書管理數據庫;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select distinct 讀者編號 from 圖書借閱表 where 還書日期 is null "
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 = "retbk.frx":324A
DataSource = "Adodc1"
Height = 315
Left = 360
TabIndex = 1
Top = 600
Width = 1575
_ExtentX = 2778
_ExtentY = 582
_Version = 393216
ListField = "讀者編號"
Text = ""
End
Begin MSDataListLib.DataCombo DataCombo2
Bindings = "retbk.frx":325F
Height = 315
Left = 2160
TabIndex = 2
Top = 600
Width = 2535
_ExtentX = 4471
_ExtentY = 582
_Version = 393216
Style = 2
ListField = "書名"
Text = ""
End
Begin MSDataListLib.DataCombo DataCombo3
Bindings = "retbk.frx":3274
Height = 315
Left = 2040
TabIndex = 4
Top = 1920
Width = 1815
_ExtentX = 3201
_ExtentY = 582
_Version = 393216
Style = 2
ListField = "借書日期"
Text = ""
End
Begin MSDataListLib.DataCombo DataCombo4
Bindings = "retbk.frx":3289
Height = 315
Left = 2040
TabIndex = 3
Top = 1320
Width = 1815
_ExtentX = 3201
_ExtentY = 582
_Version = 393216
Style = 2
ListField = "圖書編號"
Text = ""
End
Begin VB.Label Label4
BackColor = &H80000000&
Caption = "圖書編號"
Height = 255
Left = 960
TabIndex = 9
Top = 1440
Width = 1095
End
Begin VB.Label Label3
BackColor = &H80000000&
Caption = "借書日期"
Height = 255
Left = 960
TabIndex = 8
Top = 2040
Width = 1095
End
Begin VB.Label Label2
BackColor = &H80000000&
Caption = "書名"
Height = 255
Left = 3000
TabIndex = 7
Top = 360
Width = 1095
End
Begin VB.Label Label1
BackColor = &H80000000&
Caption = "讀者編號"
Height = 255
Left = 720
TabIndex = 0
Top = 360
Width = 1095
End
End
Attribute VB_Name = "retbk"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim str As String
Dim rs As ADODB.Recordset
Private Sub Command1_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
If Trim(DataCombo4.Text) = "" Then
MsgBox "先從 ‘圖書編號’ 中選擇編號", vbOKOnly + vbExclamation, "信息提示"
End If
'str = "select * from 圖書借閱表 where 讀者編號='" & Trim(DataCombo1.Text) & "'"
'Set rs = exesql(str)
If Trim(DataCombo1.Text) = "" Then
MsgBox "請輸入讀者編碼.例:0013304", vbOKOnly + vbExclamation, "信息提示"
DataCombo1.SetFocus
Exit Sub
End If
str = "select * from 圖書借閱表 where datediff(dd,借書日期,getdate())>30 and 讀者編號='" & Trim(DataCombo1.Text) & "'"
Set rs = exesql(str)
If rs.RecordCount = 0 Then
'
str = "update 圖書借閱表 set 還書日期 = getdate() where 圖書編號='" & Trim(DataCombo4.Text) & "'"
exesql (str)
str = "insert 圖書借閱歷史表 select * from 圖書借閱表 where 還書日期 is not null"
exesql (str)
str = "delete 圖書借閱表 where 圖書編號='" & Trim(DataCombo4.Text) & "'" & " and " & "讀者編號='" & Trim(DataCombo1.Text) & "'"
exesql (str)
str = "update 圖書基本信息表 set 是否在庫='1' where 圖書編號='" & Trim(DataCombo4.Text) & "'"
exesql (str)
Adodc1.Refresh
MsgBox "成功還書", vbOKOnly + vbExclamation, "信息提示"
DataCombo1.Text = ""
DataCombo2.Text = ""
DataCombo3.Text = ""
DataCombo4.Text = ""
Else
'MsgBox rs.RecordCount, vbOKOnly + vbExclamation
MsgBox "請先交納罰款!", vbOKOnly + vbExclamation, "信息提示"
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub datacombo1_gotfocus()
DataCombo2.Text = ""
DataCombo3.Text = ""
DataCombo4.Text = ""
DataCombo2.Enabled = True
End Sub
Private Sub datacombo1_lostfocus()
If DataCombo1.Text <> "" Then
Adodc2.RecordSource = "select 書名 from 圖書借閱表 where 讀者編號= '" & Trim(DataCombo1.Text) & "'"
Adodc2.Refresh
End If
DataCombo2.Enabled = True
End Sub
Private Sub datacombo2_gotfocus()
DataCombo3.Text = ""
DataCombo4.Text = ""
If Trim(DataCombo1.Text) = "" Then
MsgBox "先從 ‘讀者編號’ 中選擇讀者", vbOKOnly + vbExclamation, "信息提示"
DataCombo2.Enabled = False
End If
DataCombo3.Enabled = True
DataCombo4.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 datacombo4_gotfocus()
If Trim(DataCombo1.Text) = "" Then
MsgBox "先從 ‘讀者編號’ 中選擇讀者", vbOKOnly + vbExclamation, "信息提示"
DataCombo2.Text = ""
DataCombo2.Enabled = False
DataCombo4.Text = ""
DataCombo4.Enabled = False
End If
If Trim(DataCombo2.Text) = "" Then
MsgBox "先從 ‘書名’ 中選擇一本書", vbOKOnly + vbExclamation, "信息提示"
DataCombo4.Text = ""
DataCombo4.Enabled = False
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -