MSRDC Remote data object question... 
Author Message
 MSRDC Remote data object question...

How can I do some kind of "rollback" or "undo" when I'm updating a form
populated by TextBox controls linked on a MSRDC control without having to
do a lot of coding.  What I try to do is to have a "Cancel" button that
would use something like "MSRDC1.RollbackTransaction" or "MSRDC1.Cancel"
but it doesn't work.
P.S.: I'm querying an SQL Server 6 database via ODBC.

Thanks.



Tue, 02 Mar 1999 03:00:00 GMT  
 MSRDC Remote data object question...


wrote these mellifluous words, full of wisdom and thoughtful reflections:

Quote:
>!<How can I do some kind of "rollback" or "undo" when I'm updating a form
>!<populated by TextBox controls linked on a MSRDC control without having to
>!<do a lot of coding.  What I try to do is to have a "Cancel" button that
>!<would use something like "MSRDC1.RollbackTransaction" or "MSRDC1.Cancel"
>!<but it doesn't work.
>!<P.S.: I'm querying an SQL Server 6 database via ODBC.
>!<Thanks.

Sorry, I have to add that BEGIN/COMMIT/ROLLBACK within a SQL string remain valid
for a given connection. Therefore, you can use your strings with RDO objects
(like Resultsets), but for MSRDC (once its SQL property must be by definition
something returning a resulset) you have to resort to VB's legacy statements
BEGIN TRANS/COMMIT TRANS/ROLLBACK.


Wed, 03 Mar 1999 03:00:00 GMT  
 MSRDC Remote data object question...


wrote these mellifluous words, full of wisdom and thoughtful reflections:

Quote:
>!<How can I do some kind of "rollback" or "undo" when I'm updating a form
>!<populated by TextBox controls linked on a MSRDC control without having to
>!<do a lot of coding.  What I try to do is to have a "Cancel" button that
>!<would use something like "MSRDC1.RollbackTransaction" or "MSRDC1.Cancel"
>!<but it doesn't work.
>!<P.S.: I'm querying an SQL Server 6 database via ODBC.
>!<Thanks.

Wherever you can use SQL statements, you can code BEGIN TRANSACTION [<name>],
COMMIT TRANSACTION [<name>] and ROLLBACK TRANSACTION [<name>]. As MS writes, in
case of nested transactions you may specify the name ONLY for the topmost one.

Example:

SQLS="BEGIN TRANSACTION xact_add INSERT INTO some table .....blah, blah, blah"
Connection.Execute SQLS
SQLS="COMMIT TRANSACTION xact_add"
Connection.Execute SQLS

This will work, as well as it will if you put BEGIN TRANSACTION and INSERT into
two different strings and execute those one by one.

Hope, this helps.

Thanks.

Michael.



Wed, 03 Mar 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Question on ODBC, Remote Data objects and DAO

2. CANNOT CONNECT TO REMOTE DATA OBJECT

3. Help Please: RDO - Remote Data Objects

4. Remote Data Objects in combination with level 1 compliance level

5. RDO objects and MSRDC

6. Learn Remote Data Objects

7. Learn Remote Data Objects

8. MS Visual Basic and Remote data objects

9. Changing password with Remote Data Objects

10. Remote Data Object

11. Remote data access objects

12. Request Variable being passed to Remote Data Services Object

 

 
Powered by phpBB® Forum Software