Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO with Parameterized Views?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00494019
Message ID:
00494267
Vues:
23
>>Is there a way to pass nPKValue to the view through ADO?
>
>I knew I had sample code floating around somewhere:
LOCAL oConn as "adodb.connection"
>LOCAL oCmd as "adodb.command"
>LOCAL oRs as "adodb.recordset"
>
>oConn = CREATEOBJECT("adodb.connection")
>oConn.ConnectionString = 'Provider=VFPOLEDB.1;Data Source=C:\FOXTEST\testdbc.dbc;Password="";Collating Sequence=MACHINE'
>oConn.Open
>oCmd = CREATEOBJECT("adodb.command")
>oCmd.ActiveConnection=oConn
>
>*-- Could do it this way, too, and not pass params to Execute method.
>*--	oParam = oCmd.CreateParameter("?Cust_ID", 129, 1, 5, "ALFKI")
>*--	oCmd.Parameters.Append(oParam)
>
>oCmd.CommandText = "USE VIEW1"
>oRS = oCmd.Execute(null,"?Cust_ID")
Should that read?
oRS = oCmd.Execute(null,"ALFKI")
If not, I'm a little (or a lot<g>) confused. Where does the value of ?Cust_ID get set?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform