Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to run store procedures in VFP database from ODBC?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00579038
Message ID:
00579130
Views:
37
First all, thank for your reply.

I tryed the code of #555818 but when the command was executed I got an error.
Here is my code:
#Include adovfp.h
oConnection = CreateObject("adodb.connection")
oRS = CreateObject("adodb.recordset")
With oConnection
   .ConnectionString = "dsn=my_dsn_to_my_vfp_database;uid=;pwd=;"
   .Open
EndWith

oCommand = CreateObject("ADODB.Command")
With oCommand
   .ActiveConnection = oConnection
   .CommandType = adCmdTable
   .CommandText = "my_view"
   parParam = .CreateParameter("my_parameter_name_in_my_view", adInteger, adParamInput, 4, 1)
   .Parameters.Append(parParam)
EndWith
<b>oRS = cmdCommand.Execute</b>
With oRS
   Do While !oRS.EOF
      ? oRS.Fields("field_name_1").Value, oRS.Fields("field_name_2").Value
      oRS.MoveNext
   EndDo
EndWith

oRS.Close
oConnection.Close
When Execute command is executed, the VFP ODBC driver fire an error saying that "my_parameter_name_in_my_view" column is not found.

The view is defined as:
Create View my_view As ;
   Select my_table.field_name_1, my_table.field_name_2 ;
     From my_table ;
    Where my_table.field_name_n = ?my_parameter_name_in_my_view
What am I doing bad?
Thanks in advance!
Lic. Esteban Bruno
Gerente de Sistemas
TASSO S.R.L.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform