Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: BeginTrans / CommitTrans in ASP?


Message #1 by "Ken Mosher" <vorlon_ken@h...> on Mon, 25 Sep 2000 18:13:37 +0100
I'm coming to ASP from the VB world and sometimes stumble over the

differences...



Is there an equivalent of BeginTrans/CommitTrans in ASP?  In VB we use

these statements not only to provide for safe transactions but also to

increase performance. For instance, when inserting a large number of

records in a database you can wrap a begintrans/committrans around every

500 records and the Jet engine is much more efficient by doing a large

commit than when doing individual record insertions.



BeginTrans seems to generate an error in ASP.  I also tried 

do until oRS.eof

  oRS2.addnew

  'assign fields from oRS to oRS2

  oRS2.update

  oRS.movenext

loop

oRS2.updatebatch



and a version where the .update was removed and all I get either way is:

"Reached record 2 Error -2147217883 All HROWs must be released before new

ones can be obtained"



I created this error msg by setting "on error resume next" and then

writing a debug message, but the error number and description come from

the Err object.



I know this example is a bit forced and that I could simply call an Access

append query to copy between tables, but what if I were reading the data

from a CSV or another source?  The performance of adding 4400+ records is

not good, taking longer than an equivalent VB program, I believe.



Thanks in advance,

Ken Mosher


  Return to Index