Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Previous Error


Message #1 by "Grant I" <giswim1@a...> on Fri, 22 Jun 2001 19:03:02
OK I figured something out with the error in my last post.  If I try to 

run the search more than once in less than about 30 seconds, it gives that 

error.  In other words, the code works ok (it's been modified since i 

posted that so the errors are gone).  So I run the search.  It works.  I 

then try to run another search and it gives that error.  Anyone have any 

ideas?  I'm using Access 97 and the site is hosted on a Windows NT server 

with IIS installed (not sure what version, but pretty recent... its the IT 

department :P)
Message #2 by "Ken Schaefer" <ken@a...> on Sun, 24 Jun 2001 16:14:30 +1000
Error is probably being generated by you having locks on your database that

are not disappearing quick enough.



Things to do:

a) Ditch the ODBC driver, and use the OLEDB Provider instead:

http://www.adOpenStatic.com/faq/whyOLEDB.asp

b) If you .open something, you must .Close it. If you Set something, you Set

it = Nothing. You are not doing this in your code.

c) Open the connection as late as possible (eg build your SQL string first).

Close the connection as soon as you can

d) Use .GetRows to get the recordset into a VBScript array. This will let

you close your connection straight away. You can then iterate the array to

write stuff to the screen.

e) Read this - generally useful Jet advice:

http://www.aspalliance.com/peterjohnson/JetAdvice.asp



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----- Original Message -----

From: "Grant I" <giswim1@a...>

To: "ASP Databases" <asp_databases@p...>

Sent: Friday, June 22, 2001 7:03 PM

Subject: [asp_databases] Previous Error





: OK I figured something out with the error in my last post.  If I try to

: run the search more than once in less than about 30 seconds, it gives that

: error.  In other words, the code works ok (it's been modified since i

: posted that so the errors are gone).  So I run the search.  It works.  I

: then try to run another search and it gives that error.  Anyone have any

: ideas?  I'm using Access 97 and the site is hosted on a Windows NT server

: with IIS installed (not sure what version, but pretty recent... its the IT

: department :P)

:




  Return to Index