Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disconnected Record Sets
Message
De
09/05/2001 09:51:06
 
 
À
09/05/2001 05:14:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00504588
Message ID:
00505255
Vues:
15
This message has been marked as the solution to the initial question of the thread.
>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

For the filters, add these lines before updatebatch:

oRecordset.MarhsalOptions = 1 && adMarshalModifiedOnly
oRecordset.Filter = 1 && adFilterPendingRecords

Now, the persisted RS (the one you are opening from disk) has to be originally retrieved with batch optimistic settings or else you will get an error that states there is not enough information to make the updates.

To get error information check the errors collection on the connection object.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform