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?
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
John
RE: connecting to Access 2007 on a windows 7 64 bit machine
I appear to have stumbled on what may be the solution to my problem, here:
[url=http:/
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=h
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: