Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > Classic ASP

Closed Thread
 
LinkBack Thread Tools
Old April 15th, 2004, 01:13 PM   #1
Highly Reputable Member
 
benbacardi's Avatar
 

Join Date: Feb 2004
Location: United Kingdom
Age: 22
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 benbacardi will become famous soon enough
help

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
benbacardi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old April 16th, 2004, 04:45 AM   #2
Highly Reputable Member
 

Join Date: Jul 2003
Location: Ipswich, UK
Posts: 686
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Smokie will become famous soon enough
try using the Jet driver instead of the old ****ty access driver.

change:
Code:
'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")
to:
Code:
'Set an active connection to the Connection object using a DSN-less connection
adoCon.open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("guestbook.mdb") & ";"
Smokie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old April 16th, 2004, 04:55 AM   #3
Highly Reputable Member
 
benbacardi's Avatar
 

Join Date: Feb 2004
Location: United Kingdom
Age: 22
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 benbacardi will become famous soon enough
thanks for the advice smokie but i didnt change it and now its working :S
benbacardi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old April 16th, 2004, 07:42 AM   #4
Highly Reputable Member
 

Join Date: Jul 2003
Location: Ipswich, UK
Posts: 686
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Smokie will become famous soon enough
you should change it anyway, you are using an old and out-dated lame-ass driver, dude!
Smokie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old April 16th, 2004, 07:49 AM   #5
Highly Reputable Member
 
benbacardi's Avatar
 

Join Date: Feb 2004
Location: United Kingdom
Age: 22
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 benbacardi will become famous soon enough
lol thanx im new it was a tutorial!
benbacardi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Bookmarks

Tags
help


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0 RC8