Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Who really uses the VFPOleDB.1 provider?
Message
From
05/10/2006 04:19:33
 
 
To
04/10/2006 19:27:04
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01158763
Message ID:
01159594
Views:
23
Hi,

>>PMJI. This might be an interesting test with the VFPOLEDB provider. Basically, in the SPROC, you'd just change your SELECT to an 'INTO CURSOR' and then 'RETURN SETRESULTSET('cursorname').
>
>I have been trying to figure out the proper syntax to use such an approach. I have the following code presently and I am not sure if there is something I could do to support that approach:
>
>
>                oCommand.Connection.Open()
>
>                ' Add all command text
>                If oCommandText.Count > 0 Then
>                    For Each lcCommandText In oCommandText
>                        oCommand.CommandText = lcCommandText
>                        oCommand.ExecuteNonQuery()
>                    Next
>                End If
>
>                oCommand.CommandText = tcSQL + " INTO CURSOR Temp"
>                oCommand.ExecuteNonQuery()
>                oCommand.CommandText = "RETURN SETRESULTSET(""Temp"")"
>                oCommand.ExecuteNonQuery()
>
>                oDataAdapter.SelectCommand = oCommand
>                oDataSet = New DataSet
>
>                ' By default, .NET does not add the specific field length, which is needed in XML as at the other end
>                ' someone would always get memo field instead of character field
>                oDataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
>
>                oDataAdapter.Fill(oDataSet)
>
>
>Basically, the RETURN SETRESULTSET line is the one which is not working. I obtain:
>
>"One or more errors occurred during processing of command."
>
>I guess there is some adjustments that has to be done as I am using the data adapter to fill the dataset. Using that design, is your approach still applicable?

General Structure should be:
*VFP Stored Procedure:
PROCEDURE DoSomething
  LPARAMETERS x
  SELECT * FROM myTable WHERE something = x INTO CURSOR myCursor
  RETURN SETRESULTSET("myCursor")
ENDPROC
and in VB.NET something like:
...
With oCommand
  .CommandType = CommandType.StoredProcedure
  .CommandText = "DoSomething"
  '.Parameters.Add .....
End With
da.SelectCommand = oCommand
da.Fill(oDataSet)
Can't remember for sure whether it's a issue but JIC best use NOFILTER on the cursor to be returned...
HTH,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform