SqlCommit Function | |
Commits a transaction.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax FUNCTION SqlCommit(
nStatementHandle AS LONG
) AS LONG
public static int SqlCommit(
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.
SqlCommit( ) returns 1 if the transaction is successfully committed; otherwise, it returns -1. If
SqlCommit( ) returns -1, you can use
AError( ) to determine why the transaction could not be committed.
Remarks
If manual transactions are in effect (the SqlSetProp( ) Transactions property is set to Manual), you can send multiple updates to remote tables and
commit all the updates with SqlCommit( ).
Updates can be rolled back with SqlRollBack( ).
Examples 1= SqlSetProp(gnHandle, 'Transactions', 2)
2= SqlExec(gnHandle, "Insert Into authors (au_id, au_lname);
3VALUES ('aupoe', 'Poe')")
4= SqlCommit(gnHandle)
See Also