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)
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
更多精彩文章及讨论,请光临枫下论坛. 网址: rolia.net/zh
2002-2-21 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: ASP Problem

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论