INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

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

(OP)
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:

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 

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\wwwroot\dbs\projects.mdb 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?

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

Try changing dbs/projects.mdb to dbs\projects.mdb

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

(OP)
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.

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

What about Server.MapPath("\dbs\projects.mdb")

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

(OP)
Thanks, guitarzan, but that change had no effect.

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

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.

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

(OP)
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\wwwroot\dbs\projects.mdb

Confirmed path in command window

C:\Users\Chuck Mayo>dir C:\inetpub\wwwroot\dbs\projects.mdb
 Volume in drive C has no label.
 Volume Serial Number is 52FA-0B5A

 Directory of C:\inetpub\wwwroot\dbs

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> 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close