zombieprogrammer
Programmer
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\
I have also created an asp page called test.asp and also saved in C:\inetpub\ 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\
I have also created an asp page called test.asp and also saved in C:\inetpub\ 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?