Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFPCOM RsToCursor()
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
VFPCOM RsToCursor()
Divers
Thread ID:
00260673
Message ID:
00260673
Vues:
161
I am having troubles with the RsToCursor() method that came with VFPCOM. It works pretty good when the cursor does NOT have numeric fields.

The error that I am getting is -10. Is this a documented error? Where?
Am I doing something wrong (stupid)?

Below is the sample code that I am using. It works fine without the numeric field (field3):

* Instanciate VFPCOM and ADODB classes
clear
oComUtil = createobject("vfpcom.comutil")
oRecordSet = createobject('adodb.recordset')

* Create a dummy table with a blank record.
create table table1 ( field1 C(10), field2 D, field3 N(5,2) )
use table1
append blank
use in table1
select * from table1 into cursor MyCursor

* Copy cursor to a recordset.
select MyCursor
? 'cursortors() ->', oComUtil.cursortors( oRecordSet )
use in MyCursor

* Use the recordset.
? oRecordSet.movefirst
? oRecordSet.recordcount
? oRecordSet.fields(0).name, oRecordSet.fields(0).value

* Send the recordset back to a VFP cursor.
? 'rstocursor() ->', oComUtil.rstocursor( oRecordSet, 'MyCursor' )
? 'alias() ->', alias( 'mycursor' )

* Release classes.
oComUtil = null
oRecordSet = null
Hector Correa
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform