Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASP SQL to VFP TABLE
Message
De
21/03/2001 10:28:49
 
 
À
21/03/2001 09:23:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00487177
Message ID:
00487220
Vues:
9
>Corrected copy 2...this system isn't displaying >: and <: glyphs.
>
>I have a web .asp page via ADODB doing a "SELECT ... WHERE filed == lvar" statement that isn't working. The error I get is ][ODBC Visual FoxPro Driver]Variable 'CO_ZIP' is not found (lvar is co_zip in this case).



Ok, I assume you have something like this (in ASP):
CO_ZIP = "RI"

oRecordSet.Open "SELECT ... WHERE <i>field</i> = CO_ZIP", oConn
If this is the case, you are close, but you have to get in the mindset that ASP and Fox are separate, ie when Fox receives the SQL statement, it has no idea what CO_ZIP is. Therefore, you must create the SQL statement that already has the ASP variables "converted" for Fox (the same would apply if you were using another backend such as SQLServer. Thus, assuming CO_ZIP is a CHAR, your line should look like this:
oRecordSet.Open "SELECT ... WHERE <i>field</i> = " & CHR(34) & CO_ZIP & CHR(34), oConn
so that fox receives SELECT ... WHERE field = "RI".

Note: CHR(34) = double quotes (")

HTH!
Sylvain Demers
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform