Discussion Locked

How to populate a combo box on an ASP

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have been asked to write a browser based application so that our personnel can use wireless pocket PC's to enter their test results, which will be written to the database in real time. I am using an Access 2000 database and Front Page. I have the application written and working (data is being written correctly and records updated properly). My problem is that I do not know how to populate a combo box in Front Page from this database. I can only get it to work if I hard code the combo box choices in the HTML code. The form I am designing contains several combo boxes, some of which need to be populated from Access data. What procedure (HTML code?) do I use to read data from fields in this database and populate the combo boxes? I normally program in VB. The HTML is new to me and I can't seem to figure this one out. Any help would be appreciated.

Thanks.

5 replies

by alterego2

The only way you can do this is with VBscript or JScript within the HTML code in your asp.
If you program VB I am taking for granted that you have already instantiated a connection and recordset object and returned a recordset to the client app.

<%
Do while not rsRecordset.EOF
%>
"><%=rsRecordset("fieldname")%>
<%
rsRecordset.MoveNext
Loop
%>

This should loop through your recordset filling the value and text value of you list box with whatever recordset fileds you choose.

by alterego2

The only way you can do this is with VBscript or JScript within the HTML code in your asp.
If you program VB I am taking for granted that you have already instantiated a connection and recordset object and returned a recordset to the client app.

<%
Do while not rsRecordset.EOF
%>
"><%=rsRecordset("fieldname")%>
<%
rsRecordset.MoveNext
Loop
%>

This should loop through your recordset filling the value and text value of you list box with whatever recordset fileds you choose.

This discussion is closed to new replies.