Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disconnected Record Sets
Message
De
08/05/2001 09:27:28
 
 
À
08/05/2001 02:59:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00504588
Message ID:
00504653
Vues:
17
I think the problem with the code below is that you made the change and closed the RS without saving the changes (oRS.Save). Then reopened and tried to update. Also, the updatebatch works with an active connection only.

When doing batch updates you might want to filter your RS before sending back to the data source to minimize network traffic. Setting Filter = adFilterPendingRecords and MarshalOptions = adMarshalModifiedOnly should do the trick.

>Hi.
>
>I was trying to use Disconnected Record Sets in a little test.
>I want the application to be able to go offline. Make edits then come back on and syncronize...
>
>Here what I tried..
>
>
>The question is why can I not make offline edits?
>When I run the updatebatch I get no errors but when I reopen the data was not been saved.
>
>
>
>**TJM Offline test....Persistant
>     lcRsFileName="c:\temp\styless.rs"
>     oRecordset.Save(lcRsFileName)
>**make Change not possible at this point.
>
>**Go offline!
>     oRecordSet.close()
>     oConnection.close()
>**her the application might be shutdown
>
>
>**Here we restart application
>	oConnection = CreateObject("adodb.connection")
>	oConnection.Provider = "SQLOLEDB.1"
>	oConnection.ConnectionString = "Persist Security Info=False;Password=quest;User ID=quest;Data Source=TJM"
>	
>	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 an update
>
>        oRecordSet.fields("moc001").value='assfsadfsdafasd'
>	oRecordSet.updateBatch
>
>
>	**Simulate closing Application
>	oRecordSet.close
>		
>	***try to go online
>	oConnection = CreateObject("adodb.connection")
>	oConnection.Provider = "SQLOLEDB.1"
>	oConnection.ConnectionString = "Persist Security Info=False;Password=quest;User ID=quest;Data Source=TJM"
>	oConnection.Open
>
>	**Open and Save Offline Record Sets.
>		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")
>		oRecordSet.activeconnection=oConnection
>		oRecordSet.updatebatch
>
>
>
>When I first reopen the record set after the offline change I can not find the
>data I saved.
>
>Has anyone worked with discconected record sets?
>
>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform