| |
NigeJK
Posts: 16
Score: 0
Joined: 6/27/2005
From:
Status: offline
|
I have some code in an ASP page that fills my combobox with values from my database table. I want to fire an event when I select a value from the combo box. Here is my code so far :- <%@ LANGUAGE="VBSCRIPT" %> <HTML> <BODY> <BR>eDiary Setup Page<BR> <!-- insert the ActiveX control into the HTML page --> <OBJECT ID="ComboBox" WIDTH=96 HEIGHT=26 CLASSID="CLSID:8BD21D30-EC42-11CE-9E0D-00AA006002F3"> </OBJECT> <SCRIPT LANGUAGE="VBScript"> <!-- ' load the ActiveX control after the window has been loaded Sub Window_OnLoad() <% Set conn = Server.CreateObject("ADODB.Connection") %> <% conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("eDatabase.mdb") ' connect to the database %> <% Set rs = conn.Execute("SELECT FirstName FROM eStaff") %> <% Do While Not rs.EOF %> ComboBox.AddItem("<%= rs("FirstName") %>") ' Do an AddItem for ' each record <% rs.MoveNext %> <% Loop %> <% rs.Close %> <% conn.Close %> End Sub --> </Script> </BODY> </HTML>
|
|