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!

Server returning error on second time asp is run

Status
Not open for further replies.

schwankieog

Programmer
Jul 25, 2001
43
US
i have a basic asp page i am trying to run on a server, the code executes fine the first time you access the page, then when you hit refresh or try to send new data within 5 minutes of the first access i receive an undefined error. have no idea what is causing this, but i am pretty sure it is the server. just wondering if any one has encountered this before and if so how do you get around it?
here is the code
<%
Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
'set the path to the database on this line
mdbname = &quot;InternshipJXG.mdb&quot;
datastring = &quot;DBQ=&quot; & Server.MapPath(mdbname)
conn.Open &quot;DRIVER={Microsoft Access Driver (*.mdb)}; &quot; & datastring
query = &quot;SELECT * FROM Company&quot;
set bill = conn.execute(query)
While not bill.eof
for each blah in bill.fields
response.write blah.value & &quot; &quot;
next
response.write &quot;<br>&quot;
bill.movenext
wend
conn.close
%>

any help is appreciated
 
Do you open your access file when you run the scripts? Last time I have same problem as you 'coz I open the access file while running on the web. ------------------
Freedom is a Right
 
no the first time it happened i did have the database open, so i thought that might be it but it still acts the same wy with it closed
 
I don't know if this will help or not but if you are not destroying your conn object you might try doing that.

Set conn = Nothing

You might also check the Access database and mess with the shared or exclusive settings for the database. If it is exclusive and your object is still holding a connection to it that might be the problem.

I don't know if this will help but it may.
 
thanks for all the help guys, unfortunately it is still not working. the database is shared and i have set conn to nothing. i believe it may have something to do with the system, but was hoping it was a problem that could be fixed with code. if any one has any more ideas i would be happy to try them. thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top