SqlRollBack Function | |
Cancels any changes made during the current transaction.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax FUNCTION SqlRollBack(
nStatementHandle AS LONG
) AS LONG
public static int SqlRollBack(
int nStatementHandle
)
Request Example
View SourceParameters
- nStatementHandle
- Type: Long
Specifies the statement handle to the data source returned by SqlConnect( ).
Return Value
Type:
Long
Numeric. SqlRollBack( ) returns 1 if the transaction is successfully rolled back; otherwise, it returns -1.
If SqlRollBack( ) returns -1, you can use AError( ) to determine why the transaction could not be rolled back.
Remarks
If manual transactions are in effect (the SqlSetProp( ) transaction property is set to manual), you can send multiple updates to remote tables.
The updates can all be rolled back with SqlRollBack( ).
Updates can be committed with SqlCommit( ).
Examples 1= SqlSetProp(gnHandle, 'Transactions', 2)
2= SqlExec(gnHandle, "Insert Into authors (au_id, au_lname);
3VALUES ('aupoe', 'Poe')")
4= SqlRollBack(gnHandle)
See Also