Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>Hi All:
>
>I've been able to execute a Stored Procedure in SQL SERVER 7.0 using the ADO Command Object passing 1 parameter via a COM (.exe) I wrote in VFP. It works great and it's SUPER fast.
>
>Now I need to send THREE (3) parameters to the Stored Procedure and I'm not sure how this is done. I've tried this ...
>
>I've tried this ....
>
>DIMENSION aParameters[3]
>aParameters[1] = lnFirstVar
>aParameters[2] = lnSecondVar
>aParameters[3] = lnThirdVar
>oCommand.Execute(,@aParameters,)
>
>... and it didn't work. What am I doing wrong here? Is it possible to send more than one parameter?
>
>Thanks In Advance,
>
>Mal
While you can do it with arrays, it is more efficient if you use the parameters collection. What you have to do is define the parameters with the command's .CreateParameter method and then append them with the commands's .Append method. syntax is as follows:
prm = myCmdObject.CreateParameter(cName, nDataType, nPrmType, eValue)
myCmdObject.Append(prm)
and then just execute the with .Execute
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement