ASP Problem

mhan (Murphy)
本文发表在 rolia.net/zh 相约加拿大网上社区枫下论坛
Below is the error that occured when I run ASP to access MS Access database through OBBC. PLease advise me how to fix it.Thanks.

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
/data/readdata.asp, line 10


---ASP file---
<% @LANGUAGE = VBScript %>
<% ' Listing 13.1 Retrieving Product Data from the Northwind Database
Option Explicit
Response.Expires = 0
Dim objConn, objRS, strQuery
Dim strConnection
Set objConn = Server.CreateObject("ADODB.Connection")
'strConnection = "DSN=Northwind;Database=Nwind;"
'strConnection = strConnection & "UID=;PWD=;"
objConn.Open "Northwind"


strQuery = "SELECT Productname, UnitPrice FROM Products "
strQuery = strQuery & "ORDER BY Productname"
Set objRS = objConn.Execute(strQuery)
%>
<HTML>
<BODY>
All products stored in the Products table,
ordered by product name: <BR><BR>
<%
While Not objRS.EOF
Response.Write objRS("Productname") & " ("
Response.Write FormatCurrency(objRS("UnitPrice")) & ")<BR>"
objRS.MoveNext
Wend

objRS.close
objConn.close
Set objRS = Nothing
Set objConn = Nothing
%>
</BODY>
</HTML>
更多精彩文章及讨论,请光临枫下论坛. 网址: rolia.net/zh
(#375917@0)
2002-2-21 -05:00

回到话题: ASP Problem

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=375917