Advertisement

03.13.2008 at 06:40PM PDT, ID: 23240639
[x]
Attachment Details

VB Script sql statement need to reference session variable

Asked by ridlejo in VB Script, .NET, Programming for ASP.NET

Tags: ASP vb.net, ie 7

I am using asp vb.net to create my program.  I have an access db that hold my nodes for the tree view.  The select statement executes as expected creating my tree view.  What I want to add to the select statement is a session variable.  I want the sql statement to use the field 'user_id' that is equal to my session variable ("usr").
How do I add this in?
This is what I have right now that works.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
dim rsHits, queryString, gFldStr, gLnkStr, fi, subFolders, di
	dim usr
	usr = Session("userid")
 
    queryString = "SELECT NodeID, NodeName, IsFolder, ParentID, Link FROM NodesTable WHERE ((ParentID=" & folderId & ") AND (IsFolder=True)) ORDER BY NodeName"
 
    Set rsHits = Server.CreateObject("ADODB.Recordset")
    rsHits.Open queryString, Conn
[+][-]03.13.2008 at 06:46PM PDT, ID: 21122449

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: VB Script, .NET, Programming for ASP.NET
Tags: ASP vb.net, ie 7
Sign Up Now!
Solution Provided By: sungenwang
Participating Experts: 1
Solution Grade: A
 
 
[+][-]03.13.2008 at 06:48PM PDT, ID: 21122462

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.13.2008 at 06:53PM PDT, ID: 21122484

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.13.2008 at 06:54PM PDT, ID: 21122487

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628