永发信息网

ActiveX 部件不能创建对象: 'Server.CreateObject' ASP后台登陆验证的时候!

答案:2  悬赏:30  手机版
解决时间 2021-01-24 11:06
  • 提问者网友:像風在裏
  • 2021-01-23 18:31

<%
Dim username,password
username = request.Form("username")
password = request.Form("password")
set rs=Server.CreateObject( "ADODB.Recordset ")
sql="select * from admin where username="&user&" and password="&pass&""
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
response.Redirect("admin_login.html")
else
response.Redirect("admin.asp")
end if
Set conn=Nothing
rs.Close
%> 请帮忙看下!谢谢!
最佳答案
  • 五星知识达人网友:躲不过心动
  • 2021-01-23 19:40
set rs=Server.CreateObject( "ADODB.Recordset ")
这一句,请先去掉ADODB.Recordset前后的空格。

sql="select * from admin where username="&user&" and password="&pass&""
这一句中的user和pass二个变量从何处得来?并且两个变量是字符串,需要在前后添加'

Set conn=Nothing
rs.Close
这两句是什么意思?先关闭数据库连接,再关闭rs对象,我晕。。。

下面替你修改好了:

Dim username,password
username = Trum(request.Form("username"))
password = Trum(request.Form("password"))
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from admin where username='"&username&"' and password='"&password&"'"
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
response.Redirect("admin_login.html")
else
response.Redirect("admin.asp")
end if
rs.Close
Set rs=Nothing
Conn.Close
Set Conn=Nothing
全部回答
  • 1楼网友:渡鹤影
  • 2021-01-23 20:34
我记得jmail是有个压缩包的,里面有dll文件,你把这些文件复制拷贝到system32下试试,另外就是服务器必须开相应的端口,iis里设置smtp服务。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯