ASP Problem

mhan (Murphy)
<本文发表于: 相约加拿大:枫下论坛 >
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)
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>"

Set objRS = Nothing
Set objConn = Nothing
<本文发表于: 相约加拿大:枫下论坛 >

2002-2-21 -04:00

回到话题: ASP Problem

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