×
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.

Students Click Here

connecting to Access 2007 on a windows 7 64 bit machine

connecting to Access 2007 on a windows 7 64 bit machine

connecting to Access 2007 on a windows 7 64 bit machine

(OP)
I have recently obtained a new 64bit machine running windows 7. I have set up IIS and installed office 2007.
I then built a simple database called test.mdb containing one table called test. The database is saved in C:\inetpub\wwwroot.

I have also created an asp page called test.asp and also saved in C:\inetpub\wwwroot to connect to the database. Test.asp is about as simple as can be has the following code

Code:
--------------------------------------------------------------------------------
<%@ Language=VBScript %>
<% Option Explicit %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test</title>
<SCRIPT language="JavaScript" type="text/JavaScript" src="../js/GeneralFunctions.js"></SCRIPT>
</head>
<body>

    
<%

    Dim cnnLogin
    Dim rstLogin
    Dim strSQL

    strSQL = "SELECT * FROM test"        
    Set cnnLogin = Server.CreateObject("ADODB.Connection")

    cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb), *.accdb};" _
        & "DBQ=" & Server.MapPath("test.accdb"))

    Set rstLogin = cnnLogin.Execute(strSQL)

    If Not rstLogin.EOF Then        
    
            response.write "hello world"

    End If

    ' Clean Up
    rstLogin.Close
    Set rstLogin = Nothing
    cnnLogin.Close
    Set cnnLogin = Nothing

%>

</body>
</html>
--------------------------------------------------------------------------------


When I try to open the page in localhost I get an error message as follows;

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

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

I have perservered for over a week now and am sick of the sight of Google. I have finally given in and decided to ask for help. Could anyone please put me out of my misery and tell me how to connect to my database please?  

RE: connecting to Access 2007 on a windows 7 64 bit machine

You say you built a test database called test.mdb yet the Server.MapPath refers to test.accdb - make sure it looks at the correct filename before trying anything else.

John
 

RE: connecting to Access 2007 on a windows 7 64 bit machine

(OP)
Thanks John.

I appear to have stumbled on what may be the solution to my problem, here:

 [url=http://learn.iis.net/page.aspx/563/using-classic-asp-with-microsoft-access-databases-on-iis-70-and-iis-75/]Using Classic ASP with Microsoft Access Databases on IIS 7.0 and IIS 7.5 [/url]

It seems I need to change a setting in the application pool of IIS to enable 32 bit applications.  Anyway changing it meant that the previoulsy rejected asp page  was now accepted.

I had my suspiscions that it was an issue surrounding 64 bits / 32 bits as investigating the initial error message led me to this discussion;

 [url=http://forums.devarticles.com/microsoft-sql-server-5/data-source-name-not-found-and-no-default-driver-specified-8346.html]Data source name not found and no default driver specified[/url]

which highlights the fact that there are two ODBC managers in Windows 7. (Frankly, most of that discussion went straight over my head)  

I don't know if I have inadvertantly  fixed my original problem by altering this application pool setting or created further problems for myself elsewhere but I'll keep my fingers crossed. End result I can connect to a database and display the results on a local web page.  Happy days.

Thank you for your help in this matter. :grin:      

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! Already a Member? Login

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