Hi.
I've been trying to connect to a simple access database on my IIS server (in house) through ASP but can't connect. I know this is supposed to be the easy part but it's starting to eat away at me. I've tried creating a DSN and now a DSNless connection. I've tried a bunch of different scripts but no luck.
This is the one I'm trying now:
<html>
<head>
<title>Trial ASP</title>
</head>
<body bgcolor="#FFFFFF" text="black">
<%
Dim adoCon
Dim rsNames
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("odbc_exmp.mdb")
Set rsNames = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblNames.first_name, tblNames.last_name FROM tblNames;"
rsNames.Open strSQL, adoCon
Do While not rsNames.EOF
Response.Write ("<br>")
Response.Write (rsNames("first_name"))
Response.Write ("<br>")
Response.Write (rsNames("last_name"))
Response.Write ("<br>")
rsNames.MoveNext
Loop
rsNames.Close
Set rsNames = Nothing
Set adoCon = Nothing
%>
</body>
</html>
I get this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access 97 Driver] Can't open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.
/DB/names.asp, line 12
Any help? I would appreciate it very much. Thank you.




Bookmarks