Fill drop-down menu with elements of Dbase 
Author Message
 Fill drop-down menu with elements of Dbase

In Jscript, I made the following code to fill a drop-down menu with the
elements of the database called " country ". Since we are starting with
SiteServer, in which everything is programmed in VB, and since I'm not
fimiliar at all with this p-language, I was hoping that someone could give
me the "VB-translation" of the following code:

<%
strSQL = "SELECT DISTINCT(country) FROM country ORDER BY country";
arrSQL = cn.Execute(strSQL);

s = "";
 for (; !arrSQL.EOF; arrSQL.MoveNext())
 {
 if (strTITLE==arrSQL(0).value)
  s += '<option selected value="' + arrSQL(0) + '">'
 else
  s += '<option value="' + arrSQL(0) + '">';
  s += arrSQL(0).value;
  s += '\n';
 }

  Response.Write(s);
%>

I thank everyone in advance who is willing to spend his time on this
question. With Regards,

Dennis Sprengers



Sun, 13 Oct 2002 03:00:00 GMT  
 Fill drop-down menu with elements of Dbase

<%
s=""
Do Until arrSQL.EOF
        If strTitle=arrSQL(0).value then%>
    <option selected value=<%=arrSQL(0)%>><%=arrSQL(0)%>
<%  Else%>
    <option value=<%=arrSQL(0)%>><%=arrSQL(0)%>
<%  End If
    arrSQL.MoveNext()
Loop
%>
Hope it helps



Quote:
> In Jscript, I made the following code to fill a drop-down menu with the
> elements of the database called " country ". Since we are starting with
> SiteServer, in which everything is programmed in VB, and since I'm not
> fimiliar at all with this p-language, I was hoping that someone could give
> me the "VB-translation" of the following code:

> <%
> strSQL = "SELECT DISTINCT(country) FROM country ORDER BY country";
> arrSQL = cn.Execute(strSQL);

> s = "";
>  for (; !arrSQL.EOF; arrSQL.MoveNext())
>  {
>  if (strTITLE==arrSQL(0).value)
>   s += '<option selected value="' + arrSQL(0) + '">'
>  else
>   s += '<option value="' + arrSQL(0) + '">';
>   s += arrSQL(0).value;
>   s += '\n';
>  }

>   Response.Write(s);
> %>

> I thank everyone in advance who is willing to spend his time on this
> question. With Regards,

> Dennis Sprengers



Sun, 13 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Press F1 key while drop-down menu item highlighted, drop-down menu stays on top

2. Drop Down menu auto filling date elsewhere

3. Filling a combo drop down from access table

4. drop down edit boxes and filling them from a db

5. Dynamically fill a drop down list

6. filling a drop down usinga text file

7. Drop Down List Box - Drop Down portion does not always disappear after Click event

8. Data bound drops downs dont drop down!

9. VBA code to go to a bookmarked drop down goes to wrong drop down

10. drop down menu

11. VBscript for Dynamic Drop down menus

12. Drop down menus

 

 
Powered by phpBB® Forum Software