Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ado and parameters
Message
From
15/03/1999 15:46:35
 
 
To
15/03/1999 10:47:20
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00197285
Message ID:
00197756
Views:
17
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform