Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use parameters with SQL CE ?
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01524665
Message ID:
01524666
Views:
45
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform