asp小错误,高手来相助!!

aalei 2003-10-15 09:15:30
问:是我机器有问题还是程序有问题??

原程序为:
<html>
<head>
<title>dbtable</title>
</head>
<body bgcolor="#ffffff">
<%
set conntemp=server.createobject("adodb.connection")
conntemp.open "DSN=pubs;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pubsn data source=accp"
set rstemp=conntemp.execute("select * from publishers")
howmanyfields=rstemp.fields.count-1
%>
<table border=1>
<tr>
<%for i=0 to howmanyfields%>
<td><b><%=rstemp(i).name%></b></td>
<%next%>
</tr>
<%do while not rstemp.eof%>
<tr>
<%for i=0 to howmanyfields%>
<td valign=top><%=rstemp(i)%></td>
<%next%>
</tr>
<%rstemp.movenext
loop%>
</table>
<%
rstemp.close
set rstemp=nothing
conntemp.colse
set conntemp=nothing
%>
</body>
</html>

IE报错为:
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft OLE DB Provider for SQL Server 错误 '80040e4d'

Login failed for user 'ACCP\IUSR_ACCP'.

/dbpubslist4.asp,行8
...全文
24 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaobird1 2003-10-15
  • 打赏
  • 举报
回复
数据库连接错误。
不使用Dsn试试。

SQL Server:
conntemp.open "Driver={SQL SERVER};Server=(Local);Uid=sa;Pwd=;Databse=DBName"

Access:
conntemp.open "Driver={Microsoft Access Driver (*.mdb)};dbq=" &server.mappath("DBName.mdb")

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧