SQLCommit(), SQLRollback()
These functions control updates to a remote server when you're working with manual transactions. They're the SQL Pass Through equivalents to END TRANSACTION and ROLLBACK.
Usage |
nSuccess = SQLCommit( nConnectionHandle ) nSuccess = SQLRollback( nConnectionHandle ) |
Example |
* You can run this code from the Command Window * to see how this stuff works. * Our "Northwinds" datasource is * described in "Your Server Will Be With You in a Moment" nHandle = SQLConnect("Northwinds") ? SQLSetProp(nHandle, "Transactions", 2) ? SQLExec(nHandle, "SELECT * FROM Customers") * make the cursor updatable ? CursorSetProp("Tables", "customers") ? CursorSetProp("KeyFieldList", "customerid") ? CursorSetProp("UpdatableFieldList", "companyname") ? CursorSetProp("SendUpdates", .t.) ? CursorSetProp("UpdateNameList", ; "customerid customers.customerid, ; companyname customers.companyname") * Now change something GO 4 REPLACE CompanyName WITH "Around the Horn and Back" * Update locally ? TableUpdate() * Go over to Access and note that the record hasn't been changed ? SQLCommit(nHandle) * Now the table in Access should reflect the change * Clean up ? SQLDisconnect(nHandle) |
See Also |
CursorSetProp(), SQLConnect(), SQLDisconnect(), SQLExec(), SQLSetProp(), TableUpdate() |