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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple DB Error

Status
Not open for further replies.

daint

Technical User
Oct 4, 2000
46
GB
Hello all,

I've been trying to make a simple asp frontend for an access database. However, I keep getting an error with the line of code:

Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\travel\flights.mdb")

but only when the page is requested more than once, the first time it works fine.

Here is the base of my code,

<%
Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Conn.Open &quot;DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=&quot; & Server.MapPath(&quot;\travel\flights.mdb&quot;)

sql = &quot;select * from flights&quot;
Set RS = Conn.Execute(sql)
%>
<SOME HTML>
<%
while NOT RS.EOF
%>
<READS SOME VALUES FROM THE DB>
<%
end if
RS.MoveNext
wend
RS.Close
Conn.Close
%>

Can anyone see any obvious errors, or may it be a way in which the server is set up?

I can't set up a DSN connection on the server due to access rights, and the db was created in Access XP

Thanks

Rob
 
also try using a OLEDB connection, much less prone to errors
Conn.Open &quot;PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=&quot;& Server.MapPath(&quot;\travel\flights.mdb&quot;)

I'm betting one of these were your errors
Unable to open registry key
Unspecified Error

correct??
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top