com调用出错!
'检验用户合法性
Public Function CheckUser(strId As String, strPws As String) As String
Dim strSql As String
Set Rs = New ADODB.Recordset
strSql = "select * from user_manage where user_id = '" & strId & "' and user_pw = '" & strPws & "'"
CheckUser = strSql
Exit Function
Rs.Open strSql, Conn, adOpenStatic, adLockOptimistic
If Rs.RecordCount <= 0 Then
CheckUser = False
Else
If Rs("user_id") <> strId Or Rs("user_pw") <> strPws Then
CheckUser = False
Else
CheckUser = True
End If
End If
End Function
在asp脚本中则写了如下代码
<%
dim strUId, strUpss
dim myObj
dim flag
strUId = request("txtUId")
strUpss = request("txtPss")
if strUid <> "" and strUpss <> "" then
set myObj = server.CreateObject("czcxObj.clsCzcx")
flag = myObj.CheckUser(strUid,strUpss)
response.write flag
if flag = false then
response.Write("登录失败!")
else
response.Write("登录成功!")
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<form name="F1" method="post">
<body>
<p>用户代码:
<input type="text" name="txtUId">
</p>
<p>密 码:
<input type="text" name="txtPss">
</p>
<p>
<input type="submit" name="Submit" value="提交">
</p>
<p> </p>
</body>
</form>
</html>
运行出错啊
错误发生在
flag = myObj.CheckUser(strUid,strUpss)
这里,百思不得其解。
各位大哥帮忙看看啊,小弟不胜感激!!

