>Hi,
>
> I am using ASP and SQL Server 7.0 as a backend
>On my page i am usning 2 combos and i wan to set the listindex of those combos at run time
>
> How should i do that ? ? ?
>
>
> Pls tell me with an example . . .
>
>
>
>
>Thanx in advance,
>Amol
If I understand your question correctly, then the trick is to check the index value as you loop through your recordset and then write out the "selected" keyword into the option tag when you hit it. Something like this:
<%
intSelectedIndex = 3
Do While Not oRS.EOF%
<option
<%If oRS("index") = intSelectedIndex Then Response.Write "selected " End If%
value=<%=oRS("index")%<%=oRS("desc")<%
oRS.MoveNext
Loop
%
"It is an important and popular fact that things are not always what they seem. For instance, on the planet Earth, man had always assumed that he was more intelligent than dolphins because he had achieved so much -- the wheel, New York, wars and so on -- whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man -- for precisely the same reasons." - Douglas Adams