 |
|
 |
| |
What's
New? |
|
| |
|
|
| |
Oncoming wave with web
services - Everything you want to know about Web services, standards
and tools to develop them. - A New article
Prices
down!- Prices has been slashed down up to 20%. See the new development
rates.
News
section: A new news section has been added. We will be updating
regularly with latest trends and links. Keep an eye on the section.
Site
Maintenance - We will take care your web site. Keep them updated
and be worry free. New service from Macronimous. |
|
 |
|
 |
|
 |
|
 |
| |
Back to Code snippet Home
| 1.Database
value to List Box |
Open a database, Connect it, retrieve the values with
sql and populate the Listbox with them. |
<%
set objConn=server.createobject("adodb.connection")
objConn.open "DSN=dbDSN;uid=username;pwd=password"
set rsValues=objConn.execute("select field
from table where )
%>
<Form>
<Select>
<%
do while not rsValues.eof %>
<option> <%=rsValues(0)%> </option>
<%
rsValues.movenext
loop
rsValues.close
set rsValues = nothing
objConn.close
set objConn=nothing
%>
</Select>
</form>
|
|
Explanation:
The
code connectes the database, takes the values from
the table and stores it in a recordset (rsValues).
The values are added in to the option form filed one
by one using the do...loop and the list has been populated.
To use this code Modify the database connection details,
and sql.
|
|
|
|
|
 |
|
 |
| |
Home
I About
Us I
Services
I Price
Quote I
Resources I
Privacy Policy
I Contact
Us
|
|
|