I'LL TRY TO GIVE SOME HELP.
Sorry for the inexperienced (it's my first post)
What I see is missing is the loop thru the records in te recordset.
You have to llop thru each record in order to achieve the FName, LName pair to put it in the option of the select.
So here's th e code for before and after your line <option value="<%=FullName%>"><%=FullName%></option>
Before
<% Do While Not rsAdmin.Eof %>
I'll also change a little the select option clause just in case
<option value="<%=rsAdmin("FullName)%>"><%=rsAdmin("FullNa me")%></option>
And After
<% rsAdmin.Movenext
Loop %>
That's all (I havn't test it, may be you find something to check)
Best regards
Tell me if it works
Quote:
quote:Originally posted by mateenmohd
<%
Dim adoCon
Dim rsAdmin
Dim strSQL
set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../database/mercy.mdb")
Set rsAdmin = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT (FNAME +' '+LName) AS FullName FROM tblAdmin"
rsAdmin.Open strSQL, adoCon
%>
<form name="form1" method="post" action="">
<select name="select">
<option value="<%=FullName%>"><%=FullName%></option>
</select>
</form>
<%
rsAdmin.Close
Set rsAdmin = Nothing
Set adoCon = Nothing
%>
Quote:
quote:Originally posted by stacy
This is what I have. I don't get any errors now, but the option/list box is empty...What am I doing wrong?
<%
Dim adoCon
Dim rsAdmin
Dim strSQL
set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../database/mercy.mdb")
Set rsAdmin = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT (FNAME & ' ' & LName) AS FullName FROM [tblAdmin]"
rsAdmin.Open strSQL, adoCon
%>
<form name="form1" method="post" action="">
<select name="select">
<option value="<%=FullName%>"><%=FullName%></option>
</select>
</form>
<%
rsAdmin.Close
Set rsAdmin = Nothing
Set adoCon = Nothing
%>
|
|