Update Access database through Combo-Box in ASP page

Hi,
How can I create a combo box in an ASP page that based on a query/table?
I'd like the combo-box will contain ID and Description of list of values, so the user will see the description but after update the Database will be updated with the ID of the item that chosen by the user.

Thanks
Ronna

Comments

  • : Hi,
    : How can I create a combo box in an ASP page that based on a query/table?
    : I'd like the combo-box will contain ID and Description of list of values, so the user will see the description but after update the Database will be updated with the ID of the item that chosen by the user.
    :
    : Thanks
    : Ronna
    :
    :

    hi, you can do this;
    <%
    Set cnn = CreateObject("ADODB.Connection")
    Set rs = CreateObject("ADODB.Recordset")
    rs.CursorType =1
    rs.CursorLocation =2
    rs.LockType=1
    rs.ActiveConnection = cnn

    'add some code to update the database, try to use Request.Forms

    rs.Source = "select * from " & table_name
    rs.Open()
    %>

    While NOT rs.EOF
    Response.write "" & rs.Fields("DESCRIPTION") & ""
    rs.MoveNext()
    Wend
    rs.Close()
    Set rs = Nothing
    cnn.Close()
    Set cnn = Nothing
    %>

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion