listbox duplication

Hi all,

I have the following code which works but i need to make the sql statements independent of each other as the values in the listboxes are duplicating. Any ideas how i can stop the duplication? The output of the code is here:
<!-- m --><a class="postlink" href="http://chichester.intra/whos_who/add_staff.asp">http://chichester.intra/whos_who/add_staff.asp</a><!-- m -->


<%
dim objconn
dim strconnect
dim objrs
dim SQLstring1
dim count

set objconn = Server.CreateObject("ADODB.Connection")
strconnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= " & Server.MapPath("whos_who.mdb")

objconn.open strconnect
Set objrs = Server.CreateObject("ADODB.RecordSet")
SQLString = " SELECT * FROM Office, Divisions, Department"
objrs.open SQLString, objconn, 3, 3
count = objrs.recordcount


%>

<form action="addstaff.asp" method="post"><pre>
First Name: <input type="text" name="firstname"> Surname: <input type="text" name="surname"> Initials <input type="text" name="initials" size="4">
Ext No: <input type="text" name="ext"> Mobile No: <input type="text" name="mobile">
Email: <input type="text" name="email"> Direct Line: <input type="text" name="phone">
Time Keeper ID: <input type="text" name="tk_id"> Fax Line: <input type="text" name="fax">

Office: <select> <%do while not objrs.eof %> <option><%response.write objrs("office_name")%></option><%objrs.movenext
loop%> </select>
Property: <select> <%objrs.movefirst
do while not objrs.eof %> <option><%response.write objrs("divisions")%></option><%objrs.movenext
loop%> </select>
Department: <select name="div_list"> <%objrs.movefirst
do while not objrs.eof %> <option><%response.write objrs("department")%></option><%objrs.movenext
loop%> </select>
</pre>
<input type="Submit" name="" value="Submit"><br>
</form>
<%objrs.close
set objrs = nothing
objConn.close
set objConn=nothing
%>

Thanx in advanceIgnore that thread, i have now got it working using multiple recordsets.
 
Top