Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disconnected Record Sets
Message
 
 
À
09/05/2001 05:14:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00504588
Message ID:
00505666
Vues:
23
This message has been marked as a message which has helped to the initial question of the thread.
Hi!

When you change data, records are marked for updates internally in the ADO objects. When you save it to disk than read again by the way you shown in the sample, all these flags about what is changed are lost. Thus, when you call UpdateBatch, it cannot find anything changed, thus it cannot update data.

J.Crescencio Flores already pointed how to determine which records were changed. You than require to separately save an information about which records are changed (or just make an additional field in the ADO recordset that will hold this information). Note that new records added should be processed differently.

Than, after you read data from disk to ADO recordset, you require to mark fields as changed again to make them updated. For thous fields that have primary key .NULL. or 0 (new records) you require to delete that records and add it again to make updates correct.

HTH.


>Hej! Thanks that helped.
>
>I can now save when the record set is offline.
>But now I am stuck still trying to update these changes to the server
>to the server...
>
>Say I've made the changes offline now I am recconnecting and want to update the server.
>
>
>oConnection = CreateObject("adodb.connection")
>oConnection.Provider = "SQLOLEDB.1"
>oConnection.ConnectionString = "Persist Security Info=False;Password=quest;User ID=quest;Data Source=TJM"
>oCOnnection.Open()
>**Connected again..
>
>**open saved record set
>
>oRecordset = CreateObject("adodb.recordset")
>oRecordSet.CursorType = 3  	   &&Open Static Client default 0
>oRecordSet.LockType = 4		  &&Lock Batch Optistic  default 1
>oRecordSet.CursorLocation = 3   &&Client Side Cursor  default 2
>oRecordset.Open("c:\temp\styles.rs")
>
>**try to update server
>oRecordSet.activeconnection=oCOnnection
>oRecordSet.updateBatch
>
>
>When I do the last statement the offline changes do not get updated on the server at all and no errors.
>I suspect that it's because the change has already been saved in the local cursor file, so how could I solve this.
>
>I'm sure it may be something to do with what you said about marshalling the
>data and the filter Idea you gave me. But I don't really get how this would work. Would you be so kind as to provide a code example. Thanks a Mil.
>
>tim
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform