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!

Opening the Connection in a DSN-less Connection

Status
Not open for further replies.

mbutler55

Instructor
Feb 5, 2003
33
US
I am creating my first asp web integrated page. I obviously don't know what I am doing. Although I used to consider myself a fairly knowledgeable programmer. I am using FrontPage 2002 and Access 2000. I am on a Windows XP Professional machine with IIS installed. I created my Form in FP and then had it create the global.asa on its own based on the name of the db and tables that I provided. On my asp page I have the following code:

<%@ Language=VBScript %>
<% Option Explicit
Dim objConn
Set objConn = Server.Createobject(&quot;ADODB.Connection&quot;)
objConn.ConnectionString = &quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot; & _
&quot;DBQ=URL=fpdb/databasename.mdb&quot;
objConn.Open
%>

which came directly out of &quot;Teach yourself ASP 3.0&quot;

I do have my db named &quot;databasename.mdb.&quot; I have searched this forum as well as several other sites and no matter what changes I make, the browser can't seem to get passed the objConn.open line. I get the error message:

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

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 0xac8 Thread 0xaf4 DBC 0x1090064 Jet'.
/webfolder/checkstatus2.asp, line 8

Line 8 is in this case the objConn.Open line. Please give me some guidance as I have NO CLUE what I am doing.

 
The error you are getting usually occurrs when the access file can't be found. Try using:
objConn.ConnectionString = &quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot; & _
&quot;DBQ=&quot; & Server.MapPath(&quot;fpdb/databasename.mdb&quot;) & &quot;;&quot;
Hope that helps.
 
By the way, if there are any errors at all in the way you set up the DB connection, most likely they will show up when you try to call the Open method of the connection (hence you are getting your error at the objConn.Open line rather than where you are setting the connection string)
 
also jsut a bit of advice. instead of using the ODBC connection string use the OLE DB connection string
eg
&quot;PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=&quot;

The ODBC is known to be prone to errors

_________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
Again, I must claim my ignorance. Where exactly does that go? Does it go in place of ConnectionString? Or does it go in place of &quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot;?

Thank you.
 
objConn.ConnectionString = &quot;PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=&quot; & Server.MapPath(&quot;fpdb/databasename.mdb&quot;) & &quot;;&quot;
_________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top