Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to run store procedures in VFP database from ODBC?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00579038
Message ID:
00579130
Vues:
36
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform