| |
samajam
Posts: 1
Score: 0
Joined: 6/17/2004
From: USA
Status: offline
|
Hi all!! I would like to know how to reference an SQL table when building the criteria for IF statements in VBscript. I have the following code in an ASP page: If Session("AgtType") = "3" Then rsData.Open "Select AgentID, blah blah blah..." As you can see the criteria is hard coded but I would like to change it so that it looks in an SQL table for the values. That way I can make changes to the SQL table without having to go back to all the ASP pages to update them. I have a table called configuration with columns CfgValue and CfgOption. I want the ASP page to look at this table for all rows where CfgValue = 'Sales Assistant̉ and compare AgtType to the resulting CfgOption column (i.e. select CfgOption from configuration where CfgValue = 'Sales Assistant'). If it is equal to any of the CfgOption values then it satisfies the criteria. I hope I am making sense. I am just not sure how to go about building the VBScript statement. Thanks!! Sam
|
|