Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error on END TRANSACTION with a .tmp file
Message
From
09/05/2005 12:28:49
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01012135
Message ID:
01012196
Views:
21
Sergey, the following is the procedure used to begin the transaction:
PROCEDURE DataTransaction

LPARAMETERS plUseDBOHandle
*
* Begins a transaction on SQL and FOX 
*	NOTE: it is conceivable that these routines should start a parallel transaction
*		  on FoxPro and *all* open handles....
*


LOCAL liHandle
liHandle = IIF(plUseDBOHandle, ODBCMgr.connecteddbohandle(), ODBCMgr.PSIHandle())

IF liHandle > 0
	ODBCMgr.SQLCommand( liHandle, [BEGIN TRANSACTION ] )

	* need a foxpro trans too (or remote views will loose synch w/SQL after a rollback)
	BEGIN TRANSACTION
ENDIF

RETURN
The following is the procedure used to end the transaction:
PROCEDURE DataCommit
LPARAMETERS plUseDBOHandle

LOCAL liHandle

* IF keys are involved, commit changes and close table (to release locks)
IF USED('keycount')
	IF CursorGetProp('buffering','keycount') = 5
		TABLEUPDATE(2,.F.,'keycount')
	ENDIF
	USE IN KeyCount
ENDIF

liHandle = IIF(plUseDBOHandle, ODBCMgr.connecteddbohandle(), ODBCMgr.PSIHandle())

IF liHandle > 0
	ODBCMgr.SQLCommand( liHandle, [IF @@TRANCOUNT > 0 COMMIT TRANSACTION] )
	IF TXNLevel() > 0
		END TRANSACTION
	ENDIF
ENDIF

RETURN
Previous
Reply
Map
View

Click here to load this message in the networking platform