Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLEXEC not working with variable as parameter
Message
De
25/11/2000 19:18:56
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
24/11/2000 17:29:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00445283
Message ID:
00445429
Vues:
15
>Having trouble with SQL Passthru using VFP 6 and MS SQL 7. I suspend my app where it's failing and manually make a new connection with the following command:
>
>lnhandle=sqlconnect(DSN, UserId, PassWord) - I verify the connection is good.
>
>I define a string variable as lcSQL='Select * from Patient'
>
>This command does NOT work:
>lnRetVal = SQLEXEC(lnHandle, lcSQL, "tCursor")
>
>But this one DOES:
>lnRetVal = SQLEXEC(lnHandle, 'Select * from Patient', "tCursor")
>
>What gives???

Just a SWAG - maybe the second parameter needs to be passed by reference; in case of the literal string Fox may be doing that for you (i.e. pass the reference to the string). Just try

lnRetVal = SQLEXEC(lnHandle, @lcSQL, "tCursor")

it might work, well, if my theory holds (not that I tried it...).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform