#12001/11/19 11:14:11
我不知道在asp下如何和sql连接,设置方面肯定没问题
我使用以下的语名,可以和sql成功连接,证明sql是可连接的,但是如何使ud4和sql连接呢?
<%
set dbconnection=server.createobject("adodb.connection")
connectionstring="provider=sqloledb.1;server=real99;uid=1;pwd=111"
dbconnection.open connectionstring
set rs=server.createobject("adodb.recordset")
rs.open"login",dbconnection
dbconnection.close
%>
由于我不知道在asp下如何和sql连接,我就只是将ud4的connection改动为sql的odbc,连接仍用以前我连access的,如下:
<%@LANGUAGE="VBSCRIPT"%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_newdatabase_STRING
Recordset1.Source = "SELECT * FROM news ORDER BY date DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
结果出现这样的错误:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
/index.asp, 第 5 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
页:
GET /index.asp
请帮帮我,怎样将ud4和sql连接呢?谢谢!!!