This topic is locked

using vb in the sql query

11/8/2006 6:43:37 PM
ASPRunnerPro General questions
K
karl author

Hello,
I'm trying to filter my data set based on a users login information. In the Edit SQL query section I've entered this where statement. The problem I have is when it builds the page it is adding extra double quotes. Is there a symbol or a method I could use to prevent it from doubling up all the double quotes?
Here is what I've entered in the Edit SQL query window:

WHERE loc_id IN (SELECT locationid FROM dealership.dbo.fn_report_useraccess('"& Session("UserID") & "', 'Cash Flow Input (V.1.0)'))


Here is what the built page contains:

WHERE loc_id IN (SELECT locationid FROM dealership.dbo.fn_report_useraccess('""& Session(""UserID"") & ""', 'Cash Flow Input (V.1.0)'))


The page works as intended if I remove all the extra double quotes.

I can keep deleting the double quotes, but it seems like there should be a means for not having to do so.
Note: I'm passing the user login name to a function that returns valid locations for that user.

Alexey admin 11/9/2006

Karl,
you can add VB code to your SQL string modifying generated include\..._variables.asp file.

Change this line there:

gstrSQL = ...