Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating an ADO recordset from a VFP cursor
Message
From
14/02/2001 09:11:06
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Creating an ADO recordset from a VFP cursor
Miscellaneous
Thread ID:
00475667
Message ID:
00475667
Views:
63
I have read a thread on the 12th of january about this, but it didn't really give the answer I was looking for.

I have the following method in a multi-threaded COM object:

LParameters oRecordSet

Local lnTeller

lnTeller = 0

#DEFINE C_VFPCOMCLASS 'vfpcom.comutil'
oADO = CreateObject(C_VFPCOMCLASS)

nError = oADO.RSToCursor(oRecordSet, 'mycursor')

IF nError > 0
RETURN .F.
ENDIF

SELECT mycursor

GO TOP

SCAN ALL

lnTeller = lnTeller + 1
REPLACE mycursor.volgnr WITH PADL(ALLTRIM(STR(lnTeller)),5,'0')

ENDSCAN

oResultSet=CreateObject('ADODB.RECORDSET')
nError = oADO.CursorToRS(oRecordSet)

IF nError < 0
RETURN nError
ENDIF

RETURN oResultSet

With or without the line "oResultSet=CreateObject('ADODB.RECORDSET')" it gives me a returnvalue '-8', indicating the recordset already exists. Is there a way around this?

Johan
Next
Reply
Map
View

Click here to load this message in the networking platform