ADO Error

G

Guest

I'm trying to connect to an access 2003 database in an ASP page with the ASP code below.

<%
Dim objConn
Dim objRS
Set objConn = server.CreateObject("ADODB.Connection")
objConn.ConnectionString="Provider=MICROSOFT.JET.OLEDB.4.0;User ID=Admin;DATA SOURCE=C:\Documents and Settings\UserId\My Documents\My Data Sources\HTTracker.mdb"
objConn.Open
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "FuelPurchases", objConn, , , adCmdTable
objRS.MoveFirst
Do While Not objRS.EOF
Response.Write objRS("StopName") & " " & objRS("City") & " " & objRS("State") & "<BR>"
objRS.MoveNext
Loop
%>

Once I open the page I get the following error


Microsoft JET Database Engine (0x80004005)
The Microsoft Jet database engine cannot open the file 'C:\Documents and Settings\David Cook\My Documents\My Data Sources\HTTracker.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

Please help if you can.
 
D

Douglas J. Steele

Make sure that the ID under which IIS is running (typically
IUSR_machinename) has read, write and delete permission on the folder
C:\Documents and Settings\UserId\My Documents\My Data Sources\

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Dave said:
I'm trying to connect to an access 2003 database in an ASP page with the ASP code below.

<%
Dim objConn
Dim objRS
Set objConn = server.CreateObject("ADODB.Connection")
objConn.ConnectionString="Provider=MICROSOFT.JET.OLEDB.4.0;User
ID=Admin;DATA SOURCE=C:\Documents and Settings\UserId\My Documents\My Data
Sources\HTTracker.mdb"
objConn.Open
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "FuelPurchases", objConn, , , adCmdTable
objRS.MoveFirst
Do While Not objRS.EOF
Response.Write objRS("StopName") & " " & objRS("City") & " " &
objRS("State") & said:
objRS.MoveNext
Loop
%>

Once I open the page I get the following error


Microsoft JET Database Engine (0x80004005)
The Microsoft Jet database engine cannot open the file 'C:\Documents and
Settings\David Cook\My Documents\My Data Sources\HTTracker.mdb'. It is
already opened exclusively by another user, or you need permission to view
its data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top