Results 1 to 5 of 5

Thread: Need Help

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    9

    Unhappy

    I surely do need you guy's help...
    I'm currently developing a DHTML project...
    I'm including a htm file to the DHTML page.
    I would like to get the values of the database and display in the drop down list box. I'm using data environment...
    here's my code:
    <SELECT id=selCurrency name=selCurrency>
    <OPTION value="">Select a Currency</OPTION>
    <OPTION value="">-----------------</OPTION>
    SQL="SELECT Currency_ID, Currency FROM Currency_Code"
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set rsCurrency = fso.OpenRecordset(SQL)
    <%If Not rsCurrency.EOF Then
    Do until rsCurrency.EOF
    Response.write("<OPTION value='" & trim(rsCurrency("Currency")) & "'>" & trim(rsCurrency("Currency")) & "</OPTION>")
    rsCurrency.Movenext
    Loop
    End If%>
    </SELECT>

  2. #2
    Guest
    <SELECT id=selCurrency name=selCurrency>
    <OPTION value="">Select a Currency</OPTION>
    <OPTION value="">-----------------</OPTION>
    <%
    SQL="SELECT Currency_ID, Currency FROM Currency_Code"

    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Provider="Microsoft.Jet.OLEDB.4.0"
    objConn.ConnectionString="Data Source=" & currency.mdb
    objConn.Open

    Set rsCurrency = Server.CreateObject("ADODB.Recordset")
    rsCurrency.Open SQL, objConn,1,3

    If Not rsCurrency.EOF Then
    Do until rsCurrency.EOF
    Response.write("<OPTION value='" & trim(rsCurrency("Currency")) & "'>" & trim(rsCurrency("Currency")) & "</OPTION>")
    rsCurrency.Movenext
    Loop
    End If%>
    </SELECT>

    Here u a, not tested yet ...

    Regards,
    Mac

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    9

    Unhappy

    It still doens't work..
    Ok..Shall I put the code into the htm file or into the DHTML project? If its in the htm file, should i write a script for it.

  4. #4
    Guest
    Hi..I don't know what kind of script u a using..

    but if u using the tag <%%> then it is for ASP...

    and ur code seem using ASP ...


    Regards,
    Mac



  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    9
    Hello Marc
    I'mm not using ASP
    I found that code somewhere...
    I'm actually importing a htm file into a DHTML project. All I want the Drop Down List Box to do is to output values gathered from my access database which there's a connection to it through data environment.
    Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width