Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: dropdown box


Message #1 by "Ali M. Hijazi" <hijazia@c...> on Mon, 4 Mar 2002 14:15:45
Hi!

>

> I have a question and I hope someone out there can help me:

>

> I am writing an asp page and I need the following affect.

>

> Let' say we are talking about a software package like Outlook 2002. I 

want

> the user to be able to pick 'Outlook' from a drop down list box and then

the

> second drop down list box should automatically fill in all the different

> versions of Outlook like 1997,1998,2000,2002. The trick is that 

everything

> is stored in a database, so it's not a question of client side 

javascript.

>

> What I wanted to know is if there a way to combine the client side js and

> server side js to create that affect. In other words, when the user

chooses

> something in the first drop down, it triggers some loading from the

database

> and fills the second drop down box.

>

> If it is possible, please explain how. If it's not, maybe you can suggest

> how to achieve a behavior that's at least close to this.

>

> Thanks.

Message #2 by "Locke, Darrell (FCS/SFC)" <Darrell.Locke@g...> on Fri, 22 Mar 2002 19:35:00 -0400
Here. Have a look at this, this calls all the fields from the table spoken
and writes them to a drop down menu!

Dim Rs1,strSQL1
	Set Rs1=Server.CreateObject("ADODB.Recordset")
	strSQL1 ="SELECT * FROM Spoken;"
	Rs1.Open StrSQL1,ConnectionToDatabase
<table border="1" width="500" height="58">
    <tr>

<td width="350" height="58">
<SELECT Value="1" id=select1 name=SpokenList>
			<% If not Rs1.BOF then
					Rs1.MoveFirst 
				End If
				
				Do while not Rs1.eof %>
					<OPTION>	
				<% Response.Write Rs1("Spoken") & vbCrLf %>
					</OPTION>		
					<%
						if not Rs1.EOF then
							Rs1.MoveNext
				end if
			loop
		%>	
				
		</SELECT>
	</td>

</Table>


-----Original Message-----
From: Nichole Fettig [mailto:nikkifettig@y...] 
Sent: March 22, 2002 6:51 PM
To: ASP Databases
Subject: [asp_databases] Drop Down Box

Hi,
I'm trying to add a Drop Down Box to my ASP page using
a information from an Access Database. My question is,
do I need to write a Select statement for the Access
one? Could somebody help me? Is there anywhere I can
find a Sample code of this? Thanks in advance for your
help!
Nikki

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards(r)
http://movies.yahoo.com/

Message #3 by Nichole Fettig <nikkifettig@y...> on Fri, 22 Mar 2002 14:51:17 -0800 (PST)
Hi,
I'm trying to add a Drop Down Box to my ASP page using
a information from an Access Database. My question is,
do I need to write a Select statement for the Access
one? Could somebody help me? Is there anywhere I can
find a Sample code of this? Thanks in advance for your
help!
Nikki

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
Message #4 by "Drew, Ron" <RDrew@B...> on Sat, 23 Mar 2002 15:14:34 -0500
<SELECT name=3D"NAME" size=3D"1">
<%
   DO while not oDBr.EOF
      Response.write "<Option value=3D'" & oDBr("FieldName") & "'>"
      Response.write oDBr("FieldName") & "</Option>"
      oDBr.movenext
   Loop
   oDBr.close
   Set oDBr=3Dnothing
%>
</Select></p>

Then when you choose one in the list, your next asp page can catch your
choice thru : Variable =3D Request.form("NAME")

-----Original Message-----
From: Nichole Fettig [mailto:nikkifettig@y...]
Sent: Friday, March 22, 2002 5:51 PM
To: ASP Databases
Subject: [asp_databases] Drop Down Box


Hi,
I'm trying to add a Drop Down Box to my ASP page using
a information from an Access Database. My question is,
do I need to write a Select statement for the Access
one? Could somebody help me? Is there anywhere I can
find a Sample code of this? Thanks in advance for your
help!
Nikki

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards(r)
http://movies.yahoo.com/

Message #5 by Nichole Fettig <nikkifettig@y...> on Wed, 27 Mar 2002 13:05:27 -0800 (PST)
Hi,
Here is my code for pulling data from a database and
putting it into my Drop Down Box: 
<%
		Dim jsql, jrs, jconn
		Set jconn = CreateObject("ADODB.Connection")
		Set jrs = CreateObject("ADODB.Recordset")
		jconn = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source 
http:\\admin.ndcourts.com\news\finalproject\EventRegistration.mdb;"
		jsql = "Select eventdate, eventtime, place,
description from Events"
		jrs.Open jsql, jconn
%>
<form method="POST" action="verifyr.asp">
  <p><select size="1" name="event" multiple>
	<%While Not jrs.EOF%>
	<option value="<%jrs("eventdate, eventtime, place,
description")%>">
    <%=jrs("eventdate, eventtime, place,
description")%></option>
	<%jrs.movenext
	wend%>
	<%jrs.close
	set jrs = nothing
	jconn.close
	set jconn = nothing
	%>

But I get the error message: Microsoft JET Database
Engine (0x80004005) Not a valid file name.

Could somebody tell me what is wrong?
Thanks!
--- "Drew, Ron" <RDrew@B...> wrote:
> <SELECT name="NAME" size="1">
> <%
>    DO while not oDBr.EOF
>       Response.write "<Option value='" &
> oDBr("FieldName") & "'>"
>       Response.write oDBr("FieldName") & "</Option>"
>       oDBr.movenext
>    Loop
>    oDBr.close
>    Set oDBr=nothing
> %>
> </Select></p>
> 
> Then when you choose one in the list, your next asp
> page can catch your 
> choice thru : Variable = Request.form("NAME")
> 
> -----Original Message-----
> From: Nichole Fettig [mailto:nikkifettig@y...] 
> Sent: Friday, March 22, 2002 5:51 PM
> To: ASP Databases
> Subject: [asp_databases] Drop Down Box
> 
> 
> Hi,
> I'm trying to add a Drop Down Box to my ASP page
> using
> a information from an Access Database. My question
> is,
> do I need to write a Select statement for the Access
> one? Could somebody help me? Is there anywhere I can
> find a Sample code of this? Thanks in advance for
> your
> help!
> Nikki
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Movies - coverage of the 74th Academy
> Awards(r)
> http://movies.yahoo.com/
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
Message #6 by "Drew, Ron" <RDrew@B...> on Wed, 27 Mar 2002 17:59:56 -0500
Can not use http for data source...you need to either use physical path
or map path

mdbPath =3D Server.MapPath("..\news\finalproject\EventRegistration.mdb")
	objConn.Open "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _
                     "Data Source=3D" & mdbPath & ";" & _
                     "User Id=3Dadmin;" & _
                     "Password=3D;"
...............or........................   
    objconn.Open "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _
                 "Data
Source=3DC:\InetPub\wwwroot\news\finalproject\EventRegistration.mdb;" & 
_
                 "User Id=3Dadmin;" & _
                 "Password=3D;"

-----Original Message-----
From: Nichole Fettig [mailto:nikkifettig@y...]
Sent: Wednesday, March 27, 2002 4:05 PM
To: ASP Databases
Subject: [asp_databases] RE: Drop Down Box


Hi,
Here is my code for pulling data from a database and
putting it into my Drop Down Box:
<%
		Dim jsql, jrs, jconn
		Set jconn =3D CreateObject("ADODB.Connection")
		Set jrs =3D CreateObject("ADODB.Recordset")
		jconn =3D "Provider=3DMicrosoft.Jet.OLEDB.4.0; Data
Source =3D
http:\\admin.ndcourts.com\news\finalproject\EventRegistration.mdb;"
		jsql =3D "Select eventdate, eventtime, place,
description from Events"
		jrs.Open jsql, jconn
%>
<form method=3D"POST" action=3D"verifyr.asp">
  <p><select size=3D"1" name=3D"event" multiple>
	<%While Not jrs.EOF%>
	<option value=3D"<%jrs("eventdate, eventtime, place,
description")%>">
    <%=3Djrs("eventdate, eventtime, place, description")%></option>
	<%jrs.movenext
	wend%>
	<%jrs.close
	set jrs =3D nothing
	jconn.close
	set jconn =3D nothing
	%>

But I get the error message: Microsoft JET Database
Engine (0x80004005) Not a valid file name.

Could somebody tell me what is wrong?
Thanks!
--- "Drew, Ron" <RDrew@B...> wrote:
> <SELECT name=3D"NAME" size=3D"1">
> <%
>    DO while not oDBr.EOF
>       Response.write "<Option value=3D'" &
> oDBr("FieldName") & "'>"
>       Response.write oDBr("FieldName") & "</Option>"
>       oDBr.movenext
>    Loop
>    oDBr.close
>    Set oDBr=3Dnothing
> %>
> </Select></p>
>
> Then when you choose one in the list, your next asp
> page can catch your
> choice thru : Variable =3D Request.form("NAME")
>
> -----Original Message-----
> From: Nichole Fettig [mailto:nikkifettig@y...]
> Sent: Friday, March 22, 2002 5:51 PM
> To: ASP Databases
> Subject: [asp_databases] Drop Down Box
>
>
> Hi,
> I'm trying to add a Drop Down Box to my ASP page
> using
> a information from an Access Database. My question
> is,
> do I need to write a Select statement for the Access
> one? Could somebody help me? Is there anywhere I can
> find a Sample code of this? Thanks in advance for
> your
> help!
> Nikki
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Movies - coverage of the 74th Academy
> Awards(r)
> http://movies.yahoo.com/
>
>


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards(r)
http://movies.yahoo.com/


  Return to Index