?? jieyuedengji.dob
字號:
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 120
Top = 8040
Visible = 0 'False
Width = 1980
_ExtentX = 3493
_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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 2160
Top = 8040
Visible = 0 'False
Width = 1980
_ExtentX = 3493
_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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc3
Height = 330
Left = 4200
Top = 8040
Visible = 0 'False
Width = 1980
_ExtentX = 3493
_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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc3"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "JieYueDengJi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Dim adoRS職員 As ADODB.Recordset
Dim db As Connection
Dim strSQL As String
Private Sub cmdAdd_Click()
On Error GoTo AddErr
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("職員id").Value = txt職員id.Text
If SSTab1.Tab = 0 Then
Adodc1.Recordset.Fields("圖書id").Value = Adodc2.Recordset.Fields("圖書id").Value
If opt語言(0).Value Then
Adodc1.Recordset.Fields("語言").Value = "中"
Else
Adodc1.Recordset.Fields("語言").Value = "外"
End If
End If
Adodc1.Recordset.Update
Exit Sub
MsgBox Err.Description
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
Dim nYN As Byte
nYN = MsgBox("您正準備刪除當前記錄。" & Chr(13) & Chr(13) & _
"假如您單擊“是”,您將不能撤消這個刪除操作。" & Chr(13) & _
"您確認刪除這條記錄嗎?", vbExclamation + vbYesNo)
If nYN = vbYes Then
With Adodc1.Recordset
If .EOF And .BOF Then Exit Sub
.Delete
.MoveNext
If .RecordCount > 0 And .EOF Then
.MoveLast
ElseIf .RecordCount = 0 Then .MovePrevious
End If
End With
End If
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Private Sub cmdFilter_Click()
Dim strFilter As String
'生成filter字符串
strFilter = ""
If Trim(txt圖書id.Text) <> "" Then
strFilter = "圖書ID=" & Trim(txt圖書id.Text)
End If
If Trim(txt作者.Text) <> "" Then
If strFilter = "" Then
strFilter = "作者 like '%" & Trim(txt作者.Text) & "%'"
Else
strFilter = strFilter & " and 作者 like '%" & Trim(txt作者.Text) & "%'"
End If
End If
If txt書名.Text <> "" Then
If strFilter = "" Then
strFilter = "書名 like '%" & txt書名.Text & "%'"
Else
strFilter = strFilter & " and 書名 like '%" & txt書名.Text & "%'"
End If
End If
If DataCombo2.Text <> "" Then
If strFilter = "" Then
strFilter = "分類id=" & DataCombo2.BoundText
Else
strFilter = strFilter & " and 分類id=" & DataCombo2.BoundText
End If
End If
If opt語言(0).Value Then
If strFilter = "" Then
Adodc2.RecordSource = "select 圖書ID, 分類ID, 書名, 作者, 出版單位, 單價, 冊數, 出版日期, 登記日期, 備注, 頁數 from 中文圖書"
Else
Adodc2.RecordSource = "select 圖書ID, 分類ID, 書名, 作者, 出版單位, 單價, 冊數, 出版日期, 登記日期, 備注, 頁數 from 中文圖書 where " & strFilter
End If
Else
If strFilter = "" Then
Adodc2.RecordSource = "select 圖書ID, 分類ID, 書名, 譯名, 文種ID, 作者, 出版單位, 單價, 冊數, 出版日期, 登記日期, 備注, 頁數 from 外文圖書"
Else
Adodc2.RecordSource = "select 圖書ID, 分類ID, 書名, 譯名, 文種ID, 作者, 出版單位, 單價, 冊數, 出版日期, 登記日期, 備注, 頁數 from 外文圖書 where " & strFilter
End If
End If
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 Then
setButtons False
Else
If Trim(txt職員id.Text) = "" Then
setButtons False
Else
setButtons True
End If
End If
End Sub
Private Sub cmdFind_Click()
strSQL = "select a.職員id, a.電話, b.部門名稱 from 職員 a, 部門 b where a.部門ID=b.部門ID and 姓名 = '" & txt姓名.Text & "'"
Set adoRS職員 = db.Execute(strSQL)
If Not (adoRS職員.EOF Or adoRS職員.BOF) Then
txt職員id.Text = adoRS職員.Fields("職員id").Value
txt部門.Text = IIf(IsNull(adoRS職員.Fields("部門名稱").Value), "", adoRS職員.Fields("部門名稱").Value)
txt電話.Text = IIf(IsNull(adoRS職員.Fields("電話").Value), "", adoRS職員.Fields("電話").Value)
Else
txt職員id.Text = ""
txt部門.Text = ""
txt電話.Text = ""
MsgBox "不存在該職員,請檢查所輸入的姓名。如果添加職員,請與系統管理員聯系。", vbExclamation
End If
End Sub
Private Sub cmdRefresh_Click()
'只有多用戶應用程序需要
On Error GoTo RefreshErr
Adodc1.Refresh
Exit Sub
RefreshErr:
MsgBox Err.Description
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo UpdateErr
Adodc1.Recordset.UpdateBatch adAffectAll
Exit Sub
UpdateErr:
MsgBox Err.Description
End Sub
Private Sub cmdFindQK_Click()
Dim strFilter As String
'生成filter字符串
strFilter = ""
If Trim(txtQKMC.Text) <> "" Then
strFilter = "名稱 like '%" & Trim(txtQKMC.Text) & "%'"
End If
If Trim(txtQKYM.Text) <> "" Then
If strFilter = "" Then
strFilter = "譯名 like '%" & Trim(txtQKYM.Text) & "%'"
Else
strFilter = strFilter & " and 譯名 like '%" & Trim(txtQKYM.Text) & "%'"
End If
End If
If txtQKND.Text <> "" Then
If strFilter = "" Then
strFilter = "年度=" & txtQKND.Text
Else
strFilter = strFilter & " and 年度=" & txtQKND.Text
End If
End If
If txtQKQH.Text <> "" Then
If strFilter = "" Then
strFilter = "期號=" & txtQKQH.Text
Else
strFilter = strFilter & " and 期號=" & txtQKQH.Text
End If
End If
If strFilter = "" Then
Adodc4.RecordSource = "SELECT 期刊登記ID, 名稱, 譯名, 年度, 期號, 刊期, 庫存冊數, 借閱冊數, 在庫冊數 FROM 期刊在庫冊數 Order by 名稱, 年度, 期號"
Else
Adodc4.RecordSource = "SELECT 期刊登記ID, 名稱, 譯名, 年度, 期號, 刊期, 庫存冊數, 借閱冊數, 在庫冊數 FROM 期刊在庫冊數 where " & strFilter & " Order by 名稱, 年度, 期號"
End If
Adodc4.Refresh
If Adodc4.Recordset.RecordCount = 0 Then
setButtons False
Else
If Trim(txt職員id.Text) = "" Then
setButtons False
Else
setButtons True
End If
End If
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
If SSTab1.Tab = 0 Then
If Adodc2.Recordset.RecordCount = 0 Then
setButtons False
Else
If Trim(txt職員id.Text) = "" Then
setButtons False
Else
setButtons True
End If
End If
Else
If Adodc4.Recordset.RecordCount = 0 Then
setButtons False
Else
If Trim(txt職員id.Text) = "" Then
setButtons False
Else
setButtons True
End If
End If
End If
End Sub
Private Sub txt職員id_Change()
Dim sID As String
sID = txt職員id.Text
If sID = "" Then
With Adodc1
.RecordSource = "select 借閱ID,語言,職員ID,圖書ID,借閱日期,歸還日期 from 圖書借閱 WHERE 職員ID = -1 Order by 借閱ID;"
.Refresh
End With
setButtons False
Else
With Adodc1
.RecordSource = "select 借閱ID,語言,職員ID,圖書ID,借閱日期,歸還日期 from 圖書借閱 WHERE 職員ID = " & sID & " Order by 借閱ID;"
.Refresh
End With
If SSTab1.Tab = 0 Then
If Adodc2.Recordset.RecordCount = 0 Then
setButtons False
Else
setButtons True
End If
Else
If Adodc4.Recordset.RecordCount = 0 Then
setButtons False
Else
setButtons True
End If
End If
End If
End Sub
Private Sub UserDocument_Initialize()
With Adodc1
.ConnectionString = pConn
.RecordSource = "select 借閱ID,語言,職員ID,圖書ID,借閱日期,歸還日期 from 圖書借閱 Order by 借閱ID"
.Refresh
End With
With Adodc2
.ConnectionString = pConn
.RecordSource = "select 圖書ID, 分類ID, 書名, 作者, 出版單位, 單價, 冊數, 出版日期, 登記日期, 備注, 頁數 from 中文圖書 where 圖書ID=-1"
.Refresh
End With
With Adodc3
.ConnectionString = pConn
.RecordSource = "圖書分類"
.Refresh
End With
With Adodc4
.ConnectionString = pConn
.RecordSource = "SELECT 期刊登記ID, 名稱, 譯名, 年度, 期號, 刊期, 庫存冊數, 借閱冊數, 在庫冊數 FROM 期刊在庫冊數 where 期刊登記ID=-1 Order by 名稱, 年度, 期號"
.Refresh
End With
Set db = New Connection
db.CursorLocation = adUseClient
db.Open pConn
End Sub
Private Sub setButtons(blnEnable As Boolean)
cmdAdd.Enabled = blnEnable
cmdUpdate.Enabled = blnEnable
cmdDelete.Enabled = blnEnable
cmdRefresh.Enabled = blnEnable
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -