关于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.
为什么会出现这个问题啊!怎么才能连接成功啊!