Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFPCOM RsToCursor()
Message
From
02/09/1999 14:15:34
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00260673
Message ID:
00260733
Views:
19
>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

I've seen this error myself, but didn't have time to track down what was causing it. You can look at Ken Levy's web site, www.classx.com, for a similar conversion utility.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform