Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Begin Transaction command in VFP and SQL
Message
From
02/10/2004 12:22:57
 
 
To
01/10/2004 21:51:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00947828
Message ID:
00948223
Views:
17
>Hi Fabio,
>
>I tried modifying the code as you instructed and I found out that different remote views uses different connection handle. How can I set the remote views to use only one connection handle?
>
>
>Thanks in advance :-)

On VFP8 connectionHandles are statementHandles.

Then you have to do this:
- open the views and on Query -> Advanced .. -> Check Shared Connection

use this code
IF SQLGETPROP(CURSORGETPROP("ConnectHandle",'biophysicalrv'),"ODBChdbc");
= SQLGETPROP(CURSORGETPROP("ConnectHandle",'itemsrv'),"ODBChdbc")
   begin transaction
   iStmt = SQLCONNECT(CURSORGETPROP("ConnectHandle",'biophysicalrv'))
   SQLExec( m.iStmt, 'BEGIN TRANSACTION' )
   IF tableupdate( 2, .F., 'biophysicalrv' )
     ...
   ELSE

   ENDIF
   If lEverythingOK
     SQLExec( m.iStmt, 'IF @@TRANCOUNT > 0 COMMIT' ) && with SQLSETPROP(0,"Transactions",DB_TRANSAUTO)
*    SQLExec( m.iStmt, 'WHILE @@TRANCOUNT > 0 COMMIT' ) && with SQLSETPROP(0,"Transactions",DB_TRANSMANUAL )
     end transaction
   else
     SQLExec(  m.iStmt, 'IF @@TRANCOUNT > 0 ROLLBACK' )
     rollback
   Endif
  =SQLDISCONNECT(m.iStmt)
ELSE
  MESSAGEBOX("Set shared connection for 'biophysicalrv' and 'itemsrv'")
ENDIF
Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform