Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data source name not found and no default driver specified

Status
Not open for further replies.

kruxty

Programmer
Joined
Jul 17, 2001
Messages
197
Location
PT
This is my code:

Code:
<html>
<head>
<title>Base de Dados</title>
</head>
<body bgcolor="white" text="#000000">

<%
Dim adoCon
Dim rsGuestbook
Dim strSQL
Dim dbPath

Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Acccess Driver (*.mdb)}; DBQ=" & Server.MapPath("guestbook.mdb")
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblComments.Name, tblComments.Comments FROM tblComments;"
rsGuestbook.Open strSQL, adoCon
Do While not rsGuestbook.EOF
	response.write ("<br>")
	response.write (rsGuestbook("Name"))
	response.write ("<br>")
	response.write (rsGuestBook("Comments"))
	response.write ("<br>")
	rsGuestbook.MoveNext
Loop
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>

</body>
</html>

The error message that appears is:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/GuestBook/guestbook.asp, line 17


Any ideia? I've been trying to discover by myself but this is all new to me...
 
which line is 17 ? my guess is either :
rsGuestbook.Open strSQL, adoCon
or
adoCon.Open "DRIVER={Microsoft Acccess Driver (*.mdb)}; DBQ=" & Server.MapPath("guestbook.mdb")

but without knowming more i dunno what to tell you, other than i think you need a adlocktype on the recordset.open

[thumbsup2]DreX
aKa - Robert
 
Sorry... :P

This is line 17:
adoCon.Open "DRIVER={Microsoft Acccess Driver (*.mdb)}; DBQ=" & Server.MapPath("guestbook.mdb")

Like i told you before i'm a newbie... what is that stuff of adlocktype?
 
the error message means exactly what it says, it didn't find a database of that name in the website root folder.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
I've the asp file and mdb file in the same folder! the names are correct...
What's wrong?
 
So the file must be at c:\inetpub\wwroot\? It can't be place in other folder inside inetpub\wwroot?
Is this what you mean?
 
It can be in any folder in the website, provided you supply the correct path to server.mappath

Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
The error isn't the one you said it. [3eyes]

The error was this:

adoCon.Open "DRIVER={Microsoft AcCcess Driver (*.mdb)}; DBQ=" & Server.MapPath("guestbook.mdb").

An extra letter... it wasn't what you have written... absolutely!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top