About programming

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sanila
    New Member
    • Feb 2008
    • 1

    About programming

    hiiiiiiiii

    actually i am a student of BCA third year and i am at present
    working in a project where the front end is in ASP (VBScript)
    and the backend is in Oracle9i .I have used in it the combo box.
    And i want that when the user clicks in that combo box the data
    that are filled in the database related to that combo box should
    appear in it listing down and the user can select from it.
    So please will you mail me the code for it.
    It would be a great thankful if you solve my query.
    [email removed]
    Please do as soon as possible.
    Bye.
    Take care.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Better post your question in the ASP Forum .

    Comment

    • RedSon
      Recognized Expert Expert
      • Jan 2007
      • 4980

      #3
      Moved .

      Comment

      • DrBunchman
        Recognized Expert Contributor
        • Jan 2008
        • 979

        #4
        Hi Sanila,

        The following code will open a recorset from your database and fill the contents of a drop down list with the required data. You will have to change the code to suit your own purpose but it should give you a head start on what you're trying to achieve.

        Code:
         
        <%
        Set oConn = Server.CreateObject("ADODB.Connection") 
        oConn.Open sConnectionString
        Set oRS = Server.CreateObject ("ADODB.Recordset")
        sSQL = "SELECT Column1, Column2 FROM Tables WHERE Condition = 'True'"
        oRS.Open sSQL, oConn, 3
        %>
         
        <select name="ddExample">
        <option value=0>&nbsp;</option>
        <%
        Do While Not oRS.EOF
        Response.Write "<option value=" & oRS("Column1") & ">" & oRS("Column2") & "</option>"
        oRS.MoveNext
        Loop
        %>
        </select>
         
        <%
        oRS.close
        set oRS = nothing
        oConn.close
        set oConn = nothing
        %>
        Let me know if this helps or if you need any explanation of the code.

        Dr B

        Comment

        Working...