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!

DSN-less Connection Issues....

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
I can connect fine using the full path but I cannot get it to work when using Server.MapPath. My code is as follows:

'=======================================================
'open the database using a DSN-less connection
path = Trim(Server.MapPath("/Database"))
conn_string = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" + path + "\worklist.mdb"
Set objConn = Server.CreateObject("ADODB.Connection")

objConn.Open conn_string
'=======================================================

The ASP page is in the directory before the database directory so this seems correct to me!

I get the error message:

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 0x3f4 Thread 0x59c DBC 0x16a0a5c Jet'.
/intranet test/testing/worklist/index.asp, line 15

Not sure what to do/try next! Thanks....
 
I Seem to of sorted it out!

Used:

'open the database using a DSN-less connection
'path = Trim(Server.MapPath("/Database"))
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/intranet test/Testing/Worklist/Database/worklist.mdb") & ";"

I forgot about the web directory that I created on my IIS which needed to be in the string!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top