Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ASP SQL to VFP TABLE
Message
From
21/03/2001 10:28:49
 
 
To
21/03/2001 09:23:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00487177
Message ID:
00487220
Views:
10
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform