关于ud与数据库的连接问题,请高手们关注一下兄弟!搞了好几天都没有成功!!确实很急!!!

yzlh 2002-02-24 11:25:44
我用的是win2000+iis5.0+sql7.0.使用ud开发.在数据库连接这一块,我是按照正常的ud的连接的方法。
产生的原代码如下:
<!--#include file="Connections/myconn.asp" -->
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_myconn_STRING //ie提示出错的一行代码
Recordset1.Source = "SELECT EmployeeID, LastName, FirstName FROM dbo.Employees ORDER BY EmployeeID ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
myconn.asp的原代码如下:
MM_myconn_STRING = "dsn=yoursql;uid=sa;"

而在ie中看到的却是:HTTP 500.100 - 内部服务器错误 - ASP 错误
错误类型:Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D) /index.asp, 第 5 行

另外,有几点可以保证的是 1.我的iis没有问题,下载的原代码完全可以执行。2.我所建立的到sql数据库
的连接myconn经ud设计时的测试,完全没问题。3.有问题的是单击show live data view时,报错http error 404
(file not found) occurred while attempting to request the file. http://local/conntections/myconn_****.asp
from the application server.
here are some possible reasons for the problem:
1)there is no application server executing the asp scripts on pages in the e:/xnjs/" folder.
2)the "e:/xnjs/" folder does not map to the "http://localhost/"url on the application server.

为什么会出现这个问题啊!怎么才能连接成功啊!
...全文
88 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
希偌 2002-02-25
  • 打赏
  • 举报
回复
问题应该出在dsn身上,我怀疑是你的dsn设置成了nt信任连接。把它改为sql server认证。
试试看。
yzlh 2002-02-25
  • 打赏
  • 举报
回复
谢谢两位高手了!很多地方看到两位高手的文章!我一直是做监控工程的!最近在做公司的网站!有不懂的还请教两位了!
yzlh 2002-02-25
  • 打赏
  • 举报
回复
厉害厉害!谢谢两位高手了!看了很多两位的文章!佩服!我是搞监控工程的,现在在做我们单位的网站!有问题还要请教两位哦!
karma 2002-02-24
  • 打赏
  • 举报
回复
did you set up the correct DSN "yoursql"?

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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