Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameters to SQL proc
Message
From
13/06/2019 10:40:47
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Passing parameters to SQL proc
Miscellaneous
Thread ID:
01669053
Message ID:
01669053
Views:
92
Ok, I'll admit that it's been way too many years than I'd like to admit since I did this out of VFP, but here goes.

Got a connection to my SQL DB that works, tested by passing an SQL string like "Select * from [table]" with
msql = "Select * from [table] 
x=SQLEXEC(mconn, msql, 'Results')
And I get a cursor names Results with, you guessed it, results
But,
lastname = 'Crawford'
fname = 'Harold'
msql = "exec LookupbyName ?Lname ' " + lastname + " ',?fname '" + fname + " ' "
x=SQLEXEC(mconn, msql, 'CSO')
I get a box asking for the value of 'Lname', type that in,
x returns as -1, with the error message "Incorrect syntax near 'Crawford'
?msql shows "exec LookupbyName ?Lname 'Crawford', ?fname 'Harold' "

What am I missing?
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Next
Reply
Map
View

Click here to load this message in the networking platform