If userRD.RecordCount > 0 Then
'关闭数据库
userRD.Close
Set userRD = Nothing
userDB.Close
Set userDB = Nothing
checkGYSID = True
Screen.MousePointer = vbDefault
Else
'关闭数据库
userRD.Close
Set userRD = Nothing
userDB.Close
Set userDB = Nothing
Screen.MousePointer = vbDefault
checkGYSID = False
End If
Exit Function
errEnd:
Screen.MousePointer = vbDefault
MsgBox Err.Description, vbOKOnly + vbExclamation, "创建类别"
Err.Clear
'关闭数据库
userRD.Close
Set userRD = Nothing
userDB.Close
Set userDB = Nothing
End Function
模块名:checkFenLei
模块原型:Public Function checkFenLei(UID As String) As Boolean
代码:
Public Function checkFenLei(UID As String) As Boolean
Dim userDB As Database
Dim userRD As Recordset
Dim dbName As String
Dim STRSQL As String
Screen.MousePointer = 11
On Error GoTo errEnd
dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"
STRSQL = "select [图书分类] from [图书分类] where [图书分类]=""" & UID & """"
'打开数据库
Set userDB = DBEngine.Workspaces(0).OpenDatabase(dbName, False, True)
'检索用户,验证密码
Set userRD = userDB.OpenRecordset(STRSQL, dbOpenSnapshot)
If userRD.RecordCount > 0 Then
'关闭数据库
userRD.Close
Set userRD = Nothing
userDB.Close
Set userDB = Nothing
checkFenLei = True
Screen.MousePointer = vbDefault
Else
'关闭数据库
userRD.Close
Set userRD = Nothing
userDB.Close
Set userDB = Nothing
Screen.MousePointer = vbDefault
checkFenLei = False
End If
Exit Function
errEnd:
Screen.MousePointer = vbDefault
MsgBox Err.Description, vbOKOnly + vbExclamation, "创建类别"
Err.Clear
'关闭数据库
userRD.Close
Set userRD = Nothing
userDB.Close
Set userDB = Nothing
End Function
<< 上一页 [11] [12] [13] [14] [15] [16] 下一页