Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: select statement


Message #1 by "Rola Ali" <rola_ali@h...> on Mon, 11 Mar 2002 09:29:45 +0000
Dear all,



I have the following problem, jope anyone can help me in select statement 

and asp with visual basic.

I have a dropbox, (select statement), and it's value and caption are built 

dynamically, the value is primary key for data, and the caption is the name 

for that primary key.

it is in the form of this:





<%do while not objrs2.eof %>

<option value= <%=objrs2("key1")%>>

<%=objrs2 ("key1name")%>

</option>



<%objrs2.movenext%>



<% loop %>







Now after the select will built dynamically at run time, user should select 

any row and then a new page should opened based on the value of key1.

But actually I have 2 keys, not just 1 in which I need their values when I 

will open the next page, and the second key value should be associated with 

the first key, I tried to use this statement:





<%do while not objrs2.eof %>

<option value= <%=objrs2("key1")%>>

<%=objrs2 ("key1value")%>

</option>



coll= <%=objrs2("key2")%>



<%objrs2.movenext%>



<% loop %>



In which coll will keep the value of the second key associated with the 

first key, but I couldn't use this varaiable, it is value is empty when I 

tried to use it with this visual script:



sub deptselect_onchange()

         dept.collfreq.value= coll

         end sub



I hope you can help me.



thanks in advance.



Rola







_________________________________________________________________

Join the world?s largest e-mail service with MSN Hotmail. 

http://www.hotmail.com



Message #2 by "TomMallard" <mallard@s...> on Mon, 11 Mar 2002 06:23:20 -0800
Try...



<%do while not objrs2.eof %>

<option value="<%=objrs2("key1")%>,<%=objrs2("key2")%>"><%=objrs2

("key1value")%></option>



This will give you both keys separated by a comma to parse and use later.



HTH,



tom mallard

seattle



-----Original Message-----

From: Rola Ali [mailto:rola_ali@h...]

Sent: Monday, March 11, 2002 1:30 AM

To: ASP Web HowTo

Subject: [asp_web_howto] select statement





Dear all,



I have the following problem, jope anyone can help me in select statement

and asp with visual basic.

I have a dropbox, (select statement), and it's value and caption are built

dynamically, the value is primary key for data, and the caption is the name

for that primary key.

it is in the form of this:





<%do while not objrs2.eof %>

<option value= <%=objrs2("key1")%>>

<%=objrs2 ("key1name")%>

</option>



<%objrs2.movenext%>



<% loop %>







Now after the select will built dynamically at run time, user should select

any row and then a new page should opened based on the value of key1.

But actually I have 2 keys, not just 1 in which I need their values when I

will open the next page, and the second key value should be associated with

the first key, I tried to use this statement:





<%do while not objrs2.eof %>

<option value= <%=objrs2("key1")%>>

<%=objrs2 ("key1value")%>

</option>



coll= <%=objrs2("key2")%>



<%objrs2.movenext%>



<% loop %>



In which coll will keep the value of the second key associated with the

first key, but I couldn't use this varaiable, it is value is empty when I

tried to use it with this visual script:



sub deptselect_onchange()

         dept.collfreq.value= coll

         end sub



I hope you can help me.



thanks in advance.



Rola







_________________________________________________________________

Join the world?s largest e-mail service with MSN Hotmail.

http://www.hotmail.com








$subst('Email.Unsub').



Message #3 by "John P. Miller" <jpmiller@a...> on Mon, 11 Mar 2002 09:28:26 -0500
Create an SQL Select Statement that selects the two values from your

database that you want:



SQLValue1 = "Select data1, data2 from Table"



Create your select box:



<%do while not objrs2.eof %>

<option value= <%=objrs2(0)%>> <%=objrs2 ("key1name")%> </option>

<% Coll = objrs2(1) %>



<%objrs2.movenext

loop %>



HTH

John Miller

jpmiller@a...





----- Original Message -----

From: "Rola Ali" <rola_ali@h...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Sent: Monday, March 11, 2002 4:29 AM

Subject: [asp_web_howto] select statement





> Dear all,

>

> I have the following problem, jope anyone can help me in select statement

> and asp with visual basic.

> I have a dropbox, (select statement), and it's value and caption are built

> dynamically, the value is primary key for data, and the caption is the

name

> for that primary key.

> it is in the form of this:

>

>

> <%do while not objrs2.eof %>

> <option value= <%=objrs2("key1")%>>

> <%=objrs2 ("key1name")%>

> </option>

>

> <%objrs2.movenext%>

>

> <% loop %>

>

>

>

> Now after the select will built dynamically at run time, user should

select

> any row and then a new page should opened based on the value of key1.

> But actually I have 2 keys, not just 1 in which I need their values when I

> will open the next page, and the second key value should be associated

with

> the first key, I tried to use this statement:

>

>

> <%do while not objrs2.eof %>

> <option value= <%=objrs2("key1")%>>

> <%=objrs2 ("key1value")%>

> </option>

>

> coll= <%=objrs2("key2")%>

>

> <%objrs2.movenext%>

>

> <% loop %>

>

> In which coll will keep the value of the second key associated with the

> first key, but I couldn't use this varaiable, it is value is empty when I

> tried to use it with this visual script:

>

> sub deptselect_onchange()

>          dept.collfreq.value= coll

>          end sub

>

> I hope you can help me.

>

> thanks in advance.

>

> Rola

>

>

>

> _________________________________________________________________

> Join the world's largest e-mail service with MSN Hotmail.

> http://www.hotmail.com

>

>




$subst('Email.Unsub').




  Return to Index