Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing parameters to SQL proc
Message
De
13/06/2019 10:40:47
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Passing parameters to SQL proc
Divers
Thread ID:
01669053
Message ID:
01669053
Vues:
93
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform