Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ado and parameters
Message
De
15/03/1999 15:46:35
 
 
À
15/03/1999 10:47:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00197285
Message ID:
00197756
Vues:
19
>Lots of thoughts. :-) Sounds really optimistic.

Yes! I'm an optimist.

>omethig like this:
>parm=1
>sqls="select * from people where id='"+parm+"'"
>But VFP does not like it as far as parm = 1. (Syntax error). Work with parm='1'
>which limits id to chars only.

Wow! It's quite clear.
You get an error when trying to concatenate STRING-NUMBER-STRING. But it should be "Operator/operand type mistmach" error, not "Syntax error". For number parameter correct code will be following:

parm=1
sqls="select * from people where id="+transform(parm)

So, you can write such thing

sqls="select * from people where id="+;
iif((vartype(parm)='N'),transf(parm),'"'+parm+'"')

As far as I understand your problem was trying write the same "direct" code for different types of parameters. It cannot be made without some workarounds. If you want have your "parm" boolean, date etc as well you will have to make this expression more and more complex. Do you really need this "flexibility"?

Will above written resolve your questions? Or we are to continue?
Virtually yours, Dmitry

mailto: me@duginov.com * www.duginov.com * ICQ UIN 6769428
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform