My favorites
▼
|
Sign in
lineadecodigo
Web Code Samples in spanish
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
lineadecodigo_asp
/
ado
/
cargar-combo-desde-bd.asp
r478
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Cargar Combo desde una Base de Datos</title>
</head>
<body>
<h1>Cargar un combo desde una Base de Datos</h1>
<%
' Nos conectamos a la base de datos
Set db = Server.CreateObject("ADODB.Connection")
Dim DB_CONNECTIONSTRING
DB_CONNECTIONSTRING = "DSN=informatica-juridica.com.example"
db.open DB_CONNECTIONSTRING
' Creamos el RecordSet
Set deportes = Server.CreateObject ("ADODB.RecordSet")
SQLStr = "SELECT * FROM deportes"
deportes.open SQLStr, DB_CONNECTIONSTRING,
adOpenStatic, adLockReadOnly,adCmdText
%>
<SELECT NAME="deportes">
<%
'Recorreremos el RecordSet
do while not deportes.EOF
Response.Write("<OPTION VALUE='"
+ deportes("deporte") + "'>")
Response.Write(deportes("deporte") + "</OPTION>")
'Nos desplazamos por el RecordSet
deportes.MoveNext
loop
%>
</SELECT>
<br><br>
<hr>
Artículo disponible en: <a href="http://lineadecodigo.com/2009/02/23/cargar-combos-desde-una-base-de-datos-con-ado/">http://lineadecodigo.com/2009/02/23/cargar-combos-desde-una-base-de-datos-con-ado/</a><br/>
<a href="http://lineadecodigo.com" title="Linea de Codigo">lineadecodigo.com</a>
</body>
</html>
Show details
Hide details
Change log
r107
by vcuervo on Feb 23, 2009
Diff
Cargar combo desde una base de datos con ADO
Go to:
...sp/ado/cargar-combo-desde-bd.asp
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1407 bytes, 47 lines
View raw file
Powered by
Google Project Hosting