|
-
Mar 4th, 2002, 05:37 AM
#1
Thread Starter
Addicted Member
beginTrans,CommitTrans .. Please Help
Hi I've added a begintrans command to my code in the following way:
conn.begintrans
rs1.open
rs1.addnew
'added all my data
rs1.update
rs2.open
rs2.addnew
'added all my data
rs2.update
conn.committrans
I've then gone and delete these transactions using code like this
conn.execute "delete from table1"
when I then re-do the transaction I get the following error on the begintrans command.
when using a sequal database:
"Transaction can not start because more than one odbc connection in use
when using an access database:
"Can not set attribute at this time"
can you please tell me what I am doing wrong
-
Mar 4th, 2002, 05:52 AM
#2
Hyperactive Member
You need to have a Connection for each Recordset if you are opening them together.
Then BeginTrans & CommitTrans is used for each.
-
Mar 4th, 2002, 05:53 AM
#3
Bouncy Member
try closing each recordset after you've updated...
-
Mar 4th, 2002, 05:57 AM
#4
Hyperactive Member
try closing each recordset after you've updated...
Yes, good advice never leave a recordset open after you've used it.
Then CommitTrans after you close it and BeginTrans next line before you open it again.
Thay way you'll only need 1 connection.
-
Mar 6th, 2002, 10:32 AM
#5
Addicted Member
r u using DSN connection or ADODB connection.
if DSN change it to ADODB, then try
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|