Over the years, believe it or not, I have never used Multiple select boxes.
Now, can someone tell me where I can see some sample code for how to get
data from there and use it? Specifically, the select box will list the first
and last names of employees (this is Intranet), and I want to take the
employee ID (which would be the value of each selection) and use it on the
next page to go back into the employee table of the database and pull up
their email address, send emails using CDO, store the fact that an email was
sent into the database, etc.
I do better with sample code than philosophical explanations.
thanks 3 1616
A multiple select box gives a comma-separated list of chosen values. So
something as simple as:
sql = "SELECT * FROM table WHERE employeeID IN (" &
request.form("employeeID") & ")"
Now, it would be more complicated if these were strings, because you'd have
to insert delimiters. And don't forget earlier discussions about preventing
SQL injection...
A
"middletree" <mi********@htomail.com> wrote in message
news:Oo**************@TK2MSFTNGP10.phx.gbl... Over the years, believe it or not, I have never used Multiple select
boxes. Now, can someone tell me where I can see some sample code for how to get data from there and use it? Specifically, the select box will list the
first and last names of employees (this is Intranet), and I want to take the employee ID (which would be the value of each selection) and use it on the next page to go back into the employee table of the database and pull up their email address, send emails using CDO, store the fact that an email
was sent into the database, etc.
I do better with sample code than philosophical explanations.
thanks
> Ok, so if a user selects two people from the list, and the values are 100 and 200, then the Select statement would be
sql = "SELECT * FROM table WHERE employeeID IN ("100,200")"
Well, close... the embedded quotes wouldn't be there.
And then I would have to find a way to grab the email address (or whatever info I need) from that table for both employee 100 and employee 200. Can
you guide me on this? This is the part about which I am most confused.
sql = "SELECT employeeID, emailAddress FROM table WHERE employeeID IN (100,
200)"
set rs = conn.execute(sql)
do while not rs.eof
response.write "EmployeeID " & rs(0) & " e-mail:"
response.write rs(1) & "<br>"
rs.movenext
loop
OK, that makes sense. I appreciate it!
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:eG**************@tk2msftngp13.phx.gbl... Ok, so if a user selects two people from the list, and the values are
100 and 200, then the Select statement would be
sql = "SELECT * FROM table WHERE employeeID IN ("100,200")" Well, close... the embedded quotes wouldn't be there.
And then I would have to find a way to grab the email address (or
whatever info I need) from that table for both employee 100 and employee 200. Can you guide me on this? This is the part about which I am most confused.
sql = "SELECT employeeID, emailAddress FROM table WHERE employeeID IN
(100, 200)" set rs = conn.execute(sql) do while not rs.eof response.write "EmployeeID " & rs(0) & " e-mail:" response.write rs(1) & "<br>" rs.movenext loop
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: rbt |
last post by:
This function is intended to remove unwanted files and dirs from
os.walk(). It will return correctly *IF* I leave the 'for fs in
fs_objects' statement out (basically leave out the entire purpose of...
|
by: Nicke |
last post by:
Hi, I've used vb.net for 3 hours(!) now and have probably
a very easy question. In my VB6 programs I use For Each
Cell in Range... very often which not seems to work in
vb.net.
Ex.
Dim Cell...
|
by: Bastard_Toadflax |
last post by:
I'm making a database for a work project, and am having some
difficulties (note: I am at the novice end of the MS Access users
spectrum). Basically, what I have to do is make a list of managers in...
|
by: David Mills |
last post by:
Hello, looking for some input on how to do this query. (I'm using
Access)
John Doe 123 Main St Chicago 123
John Doe 123 Main St Chicago 456
John Doe 123 Main St Chicago 789
Given the...
|
by: greg |
last post by:
I'm sure this is easy - if someone could give me a push in the right
direction I would apprieciate it!
If you have multiple categories
CatID - NAME - ParentID
1 root 0
2 ...
|
by: jm |
last post by:
Easy probably, please read on. I know some of you have commented
already about some of my socket question. I appreciate that.
I have a Form1:
static void Main()
{
Application.Run(new...
|
by: Tim Geiges |
last post by:
I am trying to open an image in a little image viewer I wrote(it has
its own file explorer but I want it to also open from Windows Explorer)
When I select an image from widows explorer and use...
|
by: DbZ |
last post by:
Hi - i'm new to the regex thing - and trying to learn it to myself -
Can someone please explain to me what the following line does -
value.replace(/\s+$/g,"")
I can kinda figure out its...
|
by: jacob navia |
last post by:
I am trying to compile as much code in 64 bit mode as
possible to test the 64 bit version of lcc-win.
The problem appears now that size_t is now 64 bits.
Fine. It has to be since there are...
|
by: paulf.johnson |
last post by:
Hi,
For some reason, my brain has gone to mush on a couple of things. Any
help would be appreciated.
I have an array and a field passed into a function (call it $v) which
is a string composed...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| | |