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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing ms access 2000 db

Status
Not open for further replies.

help120

Technical User
Apr 15, 2001
198
US
What I'm trying to do is connect to the snitz forum database and pull some info out of the guestbook. FORUM_GUESTBOOK and I want to pull info out of the table G_varfield1. Could Some one please help me out with this code?
This is my code that I'm using to connect to the database..

<HTML>
<BODY>
<%
Dim objConn
Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
objConn.ConnectionString = &quot;DBQ=C:\inetpub\finalphase\databases\snitz_forums.mdb;DRIVER={MS Access (*.mdb)}&quot;
objConn.Open
%>

</BODY>
</HTML>

And this is the error I'm getting when I use this code

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/nps/forum/won/index.asp, line 7
 
if the database is actually part of a website you can use the following to connect

<%
dim con
Set con = server.Createobject( &quot;ADODB.Connection&quot; )
Con.Open( &quot;DRIVER={Microsoft Access driver (*.mdb)}; DBQ=&quot; & server.MapPath(&quot;(place directory path here from the page you are running ie fpdb/laws.mdb)&quot; ) )
%>
place your page here
<%
con.close
set con = nothing
%>
 
help120 - As krappleby025 illustrates, MTL, your problem stems from not correctly specifying the name of the Access ODBC driver.

DRIVER={MS Access (*.mdb)}&quot;

should be

DRIVER={Microsoft Access Driver (*.mdb)} Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top