asp 访问MySQL数据库为何出现这样的问题 老大们都来啊 100分
'=============================================================
'函数名称: CheckAccount
'用途: 检查帐号密码是否正确
'返回值: 帐号密码正确返回 帐号所属组("Admin","Common"),
' 错误返回字符串"ERROR"
Function CheckAccount(byval strConnString, byval strTableName, byval strAccount, byval strPassword)
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnString
Dim strSQL
Dim rs
strSQL = "select * from " & strTableName
strSQL = strSQL & " where ID = '"
strSQL = strSQL & strAccount & "' and Password = '"
strSQL = strSQL & strPassword & "'"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open strSQL,objConn, 1, 1
if rs.RecordCount > 0 then
CheckAccount = rs("AccountGroup")
CheckAccount = LTrim(CheckAccount)
CheckAccount = RTrim(checkAccount)
else
CheckAccount = "ERROR"
end if
set objConn = nothing
set rs = nothing
End Function
明明有符合要求的数据, 为何 rs.RecordCount总返回-1啊