Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFPCOM RsToCursor()
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
VFPCOM RsToCursor()
Miscellaneous
Thread ID:
00260673
Message ID:
00260673
Views:
160
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
Next
Reply
Map
View

Click here to load this message in the networking platform