ASP CODE:

<html>
<body>

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "D:\Inetpub\wwwroot\northwind.mdb"
cid=Request.Form("Username")
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT Username,add,pin,cost FROM Customers WHERE Username='" & cid & "'", conn
%>

<table border="1" width="100%">
<%do until rs.EOF%>
  <tr>
  <%for each x in rs.Fields%>
    <td><%Response.Write(x.value)%></td>
  <%next
  rs.MoveNext%>
  </tr>
<%loop
rs.close
conn.close
%>
</table>
Thank You for purchasing this product
</body>
</html>

I AM GETTING THIS ERROR:
Error Type:
Microsoft JET Database Engine (0x80004005)
Could not find file 'D:\Inetpub\wwwroot\northwind.mdb'.
/sample.asp, line 7

PLEASE HELP !!!!!!!!

So, I had a few minutes went back to a Windows 7 x64 with Access 2010. I was unable to get it to work with Jet 4.0, but I did get it to work with the newer provider. I didn't have to download any new drivers on my computer, just made sure that IIS had ASP enabled (which it isnt on a default install of IIS on Win7). Here is working example I just tested.

<% 
Dim oConn, oRS, ds, sql, oCmd, qs
ds = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\inetpub\wwwroot\test.mdb;Persist Security Info=False;"
sql = "SELECT * FROM myTable where ID = ?"
qs = request.QueryString("qs")

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open ds

Set oCmd = Server.CreateObject("ADODB.Command") 
oCmd.ActiveConnection = oConn
oCmd.CommandText = sql
oCmd.CommandType = 1
oCmd.Prepared = True
oCmd.Parameters(0) = qs

Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.Open oCmd

do until oRS.EOF
  for each x in oRS.Fields
    Response.Write(x.name & "=" & x.value & "<br />")
  next
  Response.Write("<br />")
  oRS.MoveNext
loop
oRS.close
oConn.close
Set oRS=nothing
Set oConn=nothing

%>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.