Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a cursor from a remote VFP stored procedure
Message
From
19/10/2004 09:28:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Returning a cursor from a remote VFP stored procedure
Miscellaneous
Thread ID:
00952580
Message ID:
00952580
Views:
1090
Hello,

I have tried almost everything I can think of to make this work, but to no avail. I also didn't find any answer on the net, although this sounds like a very classical question.

We are using VFP as a front end and a VFP database as a back end, sending commands via ADO, using the VFPOLEDB.1 OleDb provider (for those who will ask, the reason for the VFP database is we already have a VFP all-in-one software that we would like to split into a client and a remote database ; the reason for ADO is that we don't want to be bound to a VFP database and may still upgrade it to SQL Server or Oracle in the future).

For easier maintenance and integrity, I would very much like the database to be exposed only through stored procedures. Unfortunately, while everything else works fine, I have not yet been able to retrieve either a Foxpro cursor, either an ADO RecordSet from a stored procedure. All what I managed to get is a single result. I could get a RecordSet or a cursor (via the CursorAdapter) from a SQL query, but not from a stored procedure.

I heard about such a limitation with the .NET OleDb provider. Is it the same from VFP to VFP ? Is there a workaround ? I may well have missed a simple way to get these result sets, but I didn't find any documentation about this, all I could do was trying and trying.

For instance, the following naive try doesn't work and returns only a one-row recordset.
Stored procedure :
FUNCTION test_return_cursor
LOCAL result
SELECT testid, teststring FROM test INTO CURSOR result
RETURN result
ENDFUNC
Client code :
loConn.Open()
loCommand=CreateObject("ADODB.Command")
loCommand.CommandText="test_return_cursor"
loCommand.CommandType=4  && Stored procedure
loCommand.ActiveConnection=loConn
loRecordSet=loCommand.Execute()
Next
Reply
Map
View

Click here to load this message in the networking platform