Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Vbscript IF statement criteria & SQL

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,1066
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Vbscript IF statement criteria & SQL
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Vbscript IF statement criteria & SQL - 6/17/2004 6:29:09 AM   
  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
 
 
Post #: 1
 
 Re: Vbscript IF statement criteria & SQL - 8/17/2004 10:06:03 PM   
  Matt

 

Posts: 30
Score: 0
Joined: 8/17/2004
From: United Kingdom
Status: offline
So why not open a second RecordSet and pull the data out with SQL and then compaire?

Have I missed something?

(in reply to samajam)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Vbscript IF statement criteria & SQL Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts