向asp高手求救!出错啦

来源:百度知道 编辑:UC知道 时间:2024/05/04 17:45:36
错误 '80020009'
/ygrz/index.asp,行 28
----------------------------------------------
<%@ language=VBScript %>
<html>
<%set myconnection=server.createobject("adodb.connection")
set myrecordset=server.createobject("adodb.recordset")
myconnection.open "DSN=ygrzgl;UID=;PWD="
str2=lcase(Request.ServerVariables("REMOTE_USER"))
str1="userdm="
str1=str1&"'"&str2&"'"
myrecordset.activeconnection=myconnection
myrecordset.source="select * from user where "&str1
myrecordset.open
d1=cstr(formatdatetime(date()+1,2))
d2=mid(d1,6,2)&mid(d1,9,2)
d3=cstr(formatdatetime(date(),2))
d4=mid(d3,6,2)&mid(d3,9,2)

%>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsof

数据库一样吗

需要在新服务器上重新配置DSN ygrzgl

管理工具里面有个odbc数据源

---------------------------

输出以下看看sql语句,
总之你没有从数据库中查到东西

建议使用oledb方式连接数据库
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db.mdb")
--------------------------

open之后
使用response.write myrecordset.source看一下你的sql语句
使用 if myrecordset.eof then response.write "没有查询到任何数据"
看一下数据库里面到底有没有符合条件的数据

这个错误是数据库没连上,你要重新配一遍。

应该是数据源问题

看不出没有错误的