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

IIS 7.5 & Access 2013: Data source name not found and no default driver specified

Status
Not open for further replies.

cmayo

MIS
Apr 23, 2001
159
0
0
US
As a LAMP coder, I'm completely out of my element with ASP but I've agreed to do some minor updates for a new client's ASP site and I'm trying to mirror their site and create a coding/testing environment on my desktop PC.

I now have things working to the point where I can access copies of their DB (*.mdb) files using a system DSN connection string:

Code:
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.open "ACCESS2013"

but their code uses what I assume to be a DSN-less connection string that, for the life of me, I can't get working on my desktop:

Code:
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("dbs/projects.mdb")

When I use the above string, ASP tells me:

[pre]Microsoft OLE DB Provider for ODBC Drivers error '80004005'

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

/test.asp, line 27[/pre]

with line 27 being the adoCon.Open statement.

The projects.mdb db file does exist where I think the server is looking for it at C:\inetpub\ and permissions on and to the file seem wide open.

The ODBC Data Source Administrator reports that the Microsoft Access Driver (*.mdb *.accdb) version 15.00.5414.1000 is installed, so I guess there's a disconnect between IIS and the driver?

Any ideas/suggestions I might try?
 
Try changing dbs/projects.mdb to dbs\projects.mdb
 
xwb: Try changing dbs/projects.mdb to dbs\projects.mdb

Good thought, but no change.

The original developer wrote the DB connection into every page on the site so unless I want to edit all those files individually, it would be preferable to figure out how to make my IIS/Access/ODBC run the production code as-is.

In the end I may wind up just doing what should have been done in the first place and make the DB connections with an include file, at which point I can run the same code on both servers and just use different includes to make the connection on each machine.
 
Thanks, guitarzan, but that change had no effect.
 
Can you msgbox what Server.MapPath("dbs\projects.mdb") returns? It may give you some clues as to whether it can map the file or not and where it thinks it is as opposed to where it actually is.
 
Good idea, but the file is where IIS thinks it is (below).

Last night I went ahead and moved all the site's database connection code to a couple include files, so now I can connect with DSN on my development box and continue to use the DSN-less connection on the production server. Other than the two connection includes, the production code now runs unchanged on the dev box, problem solved.

Thanks much for the help!

Code:
ASP code

<%
Response.Write(Server.MapPath("dbs\projects.mdb")) 
%>

Produces:
C:\inetpub\[URL unfurl="true"]wwwroot\dbs\projects.mdb[/URL]

Confirmed path in command window

C:\Users\Chuck Mayo>dir C:\inetpub\[URL unfurl="true"]wwwroot\dbs\projects.mdb[/URL]
 Volume in drive C has no label.
 Volume Serial Number is 52FA-0B5A

 Directory of C:\inetpub\[URL unfurl="true"]wwwroot\dbs[/URL]

09/19/2014  11:27 AM           458,752 projects.mdb
               1 File(s)        458,752 bytes
               0 Dir(s)  17,557,995,520 bytes free

C:\Users\Chuck Mayo>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top