|
|
|
สอบถามหน้าจอสำหรับแก้ไขข้อมูลให้ dropdownlist เลือกข้อมูลจาก DB ออกมาแสดง |
|
|
|
|
|
|
|
Code (ASP)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<%
Dim Conn,strSQL,objRec
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("db/mydatabase.mdb"),"" , ""
%>
<body>
<form action="asp_listmenu_datebase2.asp" method="post" name="form1">
List Menu<br>
<select name="lmName1">
<option value=""><-- Please Select Item --></option>
<%
strSQL = "SELECT * FROM customer "
Set objRec = Server.CreateObject("ADODB.Recordset")
objRec.Open strSQL, Conn, 1,3
While Not objRec.EOF
%>
<option value="<%=objRec.Fields("CustomerID").Value%>"><%=objRec.Fields("CustomerID").Value & " - " & objRec.Fields("Name").Value%></option>
<%
objRec.MoveNext
Wend
%>
</select>
<input name="btnSubmit" type="submit" value="Submit">
</form>
</body>
</html>
<%
objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
%>
|
|
|
|
|
Date :
2010-08-05 17:23:38 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|