Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JET database Engine and Access from ASP

Status
Not open for further replies.

georgizas

Programmer
Sep 13, 2001
15
GR
I try to connect from my ASP page to an access database which is on a server on network.
My code is hereQ
set cn=server.CreateObject("ADODB.connection")
set rs=server.CreateObject("ADODB.recordset")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=//Info/db_pepdym/pepdym.mdb"

rs.Open "SELECT * FROM tblCalls", cn, 1, 1
If not rs.EOF then
rs.movefirst
Do while not rs.EOF
Response.Write "<b>" & rs("Id") & "</b>" &" "
Response.Write "<b>" & rs("Title") & "</b>" & "<br>"
rs.movenext
Loop
end if
cn.Close
But it doesnt work. I think the The problem is that the database is on the network. What can i do?
 
Perhaps change:

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=//Info/db_pepdym/pepdym.mdb"

to:

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\Info\db_pepdym\pepdym.mdb"

 
Also forgot to ask if the database is on the webserver or not. If it isn't you could change the anonymous user for that website to a domain user that has access to that file.
 
Ok I used a domain user and it works. Thank you.
Do you have an opinion about security problems?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top