ADO Update the Database with the modify done on a disconnected recordset in background mode 
Author Message
 ADO Update the Database with the modify done on a disconnected recordset in background mode

Hallo,
we would execute this operations
-open a disconnected recordset
-modify a recordset
-connected again the recordset to Database for copy the modified recordset
in Background mode( Asynchronous mode)

This is what we have done

RsDis.CursorLocation = adUseClient 'tipo client
RsDis.Open "TabCivici", cn, adOpenKeyset, adLockBatchOptimistic, adcmdTable
Set RsDis.ActiveConnection = Nothing ' disconnect the recordset

'qui le modifiche a rsDis
'...

This is what we have done for the synchronous update (it's work)

'we open an empty recordset, we connected the recordset with
'an disconnected recordset, and we make an update
Dim rsCon As new recordset
Set RsCon.ActiveConnection = cn
RsCon.Open RsDis, cn
RsCon.UpdateBatch 'We make an Update but not in background(the program stop
until the finish of operation)

For Asynchronous Update we have tried to do in this way bat it doesnt'
work(the istruction "open" give an error)

Dim WithEvents rsCon As recordset
Set rsCon = new Recordset
Set RsCon.ActiveConnection = cn
RsCon.Open RsDis, cn, adOpenDynamic, adLockOptimistic, adAsyncExecute
RsCon.UpdateBatch

Is it possible update the Database with the modify done on a disconnected
recordset in background mode?



Tue, 31 Dec 2002 03:00:00 GMT  
 ADO Update the Database with the modify done on a disconnected recordset in background mode



Quote:
>Hallo,
>we would execute this operations
>-open a disconnected recordset
>-modify a recordset
>-connected again the recordset to Database for copy the modified
>recordset in Background mode( Asynchronous mode)

>This is what we have done

>RsDis.CursorLocation = adUseClient 'tipo client
>RsDis.Open "TabCivici", cn, adOpenKeyset, adLockBatchOptimistic,
>adcmdTable Set RsDis.ActiveConnection = Nothing ' disconnect the
>recordset

>'qui le modifiche a rsDis
>'...

>This is what we have done for the synchronous update (it's work)

>'we open an empty recordset, we connected the recordset with
>'an disconnected recordset, and we make an update
>Dim rsCon As new recordset
>Set RsCon.ActiveConnection = cn
>RsCon.Open RsDis, cn
>RsCon.UpdateBatch 'We make an Update but not in background(the program
>stop until the finish of operation)

>For Asynchronous Update we have tried to do in this way bat it doesnt'
>work(the istruction "open" give an error)

>Dim WithEvents rsCon As recordset
>Set rsCon = new Recordset
>Set RsCon.ActiveConnection = cn
>RsCon.Open RsDis, cn, adOpenDynamic, adLockOptimistic, adAsyncExecute
>RsCon.UpdateBatch

>Is it possible update the Database with the modify done on a
>disconnected recordset in background mode?

Yes, you can do this.  I bought the book "Programming ADO" by David
Sceppa (Microsoft Press) ISBN = 0-7356-0764-8.  Very good book.  One of
the thing in the book is how to do this.

He talks about updating disconnected record sets, reconnecting, and using
batch update.  You will have to do this.  In order to get your empty
recordset, you will have to specify a valid a valid SQL statement in the
open that returns no rows.

SELECT * FROM MyTable WHERE 1 > 2

This gives you a valid (but empty) recordset.  Now you can update that.

ATB

Charles Kincaid



Sun, 02 Feb 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO Is it possible update the Database with the modify done on a disconnected recordset in background mode?

2. Disconnected ADO Recordset-Updating

3. Urgent: Update Oracle disconnected recordset using ADO 2.6 and VB6

4. Update on disconnected ADO Recordset

5. Sybase and updating ADO disconnected recordset

6. Can I update a disconnected recordset in ADO

7. Reconnecting a disconnected ADO recordset for update

8. ADO fails to release Recordset cursor after opening disconnected Recordset

9. Creating Dynamic ADO Recordsets and Updating Database

10. Load XML file to a RecordSet then Update Database using ADO

11. ADO RECORDSET - update database issue

12. Update Database from a created(from scratch) ADO recordset

 

 
Powered by phpBB® Forum Software