Q: VB + MS SQL Server and transactions 
Author Message
 Q: VB + MS SQL Server and transactions

Why do these not work:

#1: Any transactions in MySP are always commited

  On Error GoTo DBError

  db.BeginTrans
  n = db.ExecuteSQL("execute sp1 ...")
  ...
  n = db.ExecuteSQL("execute spN ...")
  db.CommitTrans
  Exit Sub

DBError:
  db.Rollback
  Exit Sub

#2: Gives an invalid argument error at db.Execute "begin transaction"

  On Error GoTo DBError

  db.Execute "begin transaction", DB_SQLPASSTHROUGH
  n = db.ExecuteSQL("execute sp1 ...")
  ...
  n = db.ExecuteSQL("execute spN ...")
  db.Execute "commit transaction", DB_SQLPASSTHROUGH
  Exit Sub

DBError:
  db.Execute "rollback transaction", DB_SQLPASSTHROUGH
  Exit Sub

...While this one does work:  

#3: Works fine -- commits and rolls back as expected

  On Error GoTo DBError

  n = db.ExecuteSQL("begin transaction")
  n = db.ExecuteSQL("execute sp1 ...")
  ...
  n = db.ExecuteSQL("execute spN ...")
  n = db.ExecuteSQL("commit transaction")
  Exit Sub

DBError:
  db.ExecuteSQL("rollback transaction")
  Exit Sub



Wed, 20 Aug 1997 01:23:36 GMT  
 Q: VB + MS SQL Server and transactions

        I have some questions about SHARED databases... I am doing a VB application that will be run over a network. Several users will undeniably access the data at the same time. I was wondering if you could give me any tips on making a robust relative databases system. I am a bit familiar with dBase 4 databases... Bu tI have some conflict problems when several users access the file... Also, I am using Q+E Multilink 2 for VB... So I need tips on making a ROBUST multi-users system. Any tips? Thanks a lot!

        Jean-Francois Prevost



Mon, 25 Aug 1997 06:22:48 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Why to use COM+ transaction and not just SQL Server transaction

2. Why to use COM+ transaction and not just SQL Server transaction

3. VB and nested SQL Server 7 transactions-- possible?

4. MS Transaction Server

5. Could a MS Transaction Server (MSDTC) Expert please email me :))

6. Executing MS SQL Server 2000 stored procs via MS Access 2000

7. Moving Oracle records to MS SQL Server using MS Access

8. Complicated Record Handling on MS Sql server and MS Accesses Databases

9. CA-Prog Analyst, MS SQL Server, Visual Basic and MS Access

10. Access to MS ACCES and MS SQL server

11. MS Access 2002 vs VB.net as a front-end to SQL Server data

12. Connecting MS Acess and SQL Server from VB.net

 

 
Powered by phpBB® Forum Software