?? mdlvar.bas
字號:
Attribute VB_Name = "mdlVar"
'聲明全局變量
Public g_CurUserID As Long
Public g_bLogin As Boolean
Public g_bAdmin As Boolean
'查找用戶
Public Function IsExistUser(strUserName As String, strpwd As String) As Boolean
Dim cmd As Command
Dim rs As Recordset
Set cmd = New Command
'打開連接
If DataE.conLibrary.State = adStateClosed Then
DataE.conLibrary.Open
End If
cmd.ActiveConnection = DataE.conLibrary
'注冊
cmd.CommandText = "select * from usertable where username='" & strUserName & "'"
If strpwd <> "" Then
'登錄
cmd.CommandText = cmd.CommandText + "and pwd='" & strpwd & " '"
End If
'有無重復(fù)
Set rs = cmd.Execute
If rs.RecordCount <> 0 Then
IsExistUser = True
If g_bLogin Then
If rs!usertype <> Guest Then
g_CurUserID = rs!userid
End If
'為管理員
If rs!usertype = Manager Then
g_bAdmin = True
End If
End If
Else
IsExistUser = False
End If
End Function
'查找某特定書籍
Public Function IsExistBook(strbookname As String, intIndex As Integer) As Boolean
'打開連接
DataE.conLibrary.Close
DataE.conLibrary.Open
DataE.cmdRegBook strbookname, intIndex
If DataE.rscmdRegBook.RecordCount <> 0 Then
IsExistBook = True
Else
IsExistBook = False
End If
End Function
'查找相同書名的書籍
Public Function IsExistBooks(strbookname As String) As Integer
DataE.conLibrary.Close
DataE.conLibrary.Open
DataE.cmdFindBooks strbookname
IsExistBooks = DataE.rscmdFindBooks.RecordCount
End Function
Public Sub CloseWin()
Dim frm As Form
On Error GoTo wrong
Set frm = mdiFrm.ActiveForm
Unload frm
wrong:
Exit Sub
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -