I have this code trying to reach an access database:
Code:
<html>
<head>
<title>Guestbook</title>
</head>
<body>
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsGuestbook 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database
'Create and ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("guestbook.mdb")
'Create an ADO recordset object
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblComments.Name, tblComments.Comments FROM tblComments;"
'Open the recordset with the SQL query
rsGuestbook.Open strSQL, adoCon
'Loop through the recordset
Do While not rsGuestbook.EOF
Response.Write ("
")
Response.Write (rsGuestbook("Name"))
Response.Write ("
")
Response.Write (rsGuestbook("Comments"))
Response.Write ("
")
rsGuestbook.MoveNext
Loop
'Reset server objects
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>
</body>
</html>
and the database is in the same folder, and is called guestbook.mdb. do any of you understand why i get the error:
Code:
Technical Information (for support personnel)
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x134 Thread 0x298 DBC 0x1019e7c Jet'.
/test/guestbook.asp, line 14
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Page:
GET /test/guestbook.asp
Time:
Thursday, April 15, 2004, 6:06:44 PM
More information:
Microsoft Support
Thanks