Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use parameters with SQL CE ?
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01524665
Message ID:
01524666
Vues:
47
>Hello : How to using parameters with VFP and SQLCE 3.5, ?
>
>
>CadCon="Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=C:\Employes.SDF;SSCE:Database Password='';"
>oc = CREATEOBJECT('adodb.connection')
>oc.open(CadCon)
>
>* Create Command
>oComm=CREATEOBJECT("ADODB.COMMAND")
>oComm.activeConnection=oc
>
>* Select all records (ok)
>cSQL="Select * from Employes"
>mytabla=oc.execute(cSql)
>
>*Now how to select selective records using Variables, because the following code is not working
>cSQL="SELECT FROM EMPLOYE WHERE NAME = ? VP_NAME
>myTabla=oc.execute(cSql)
>
>Thanks very much!

There is a typo in your last command, it should be

cSQL = 'SELECT * from Employees where Name = ?m.VFPVariable'

Also, why do you use adodb.connection? Can you simply use sqlexec instead?

If not, I guess you need to use ADODB.COMMAND parameters collection to set your parameters.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform