PDA

Click to See Complete Forum and Search --> : Need Help


barryooi
Jan 17th, 2001, 10:29 PM
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>

Jan 17th, 2001, 11:09 PM
<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,
:o Mac :)

barryooi
Jan 17th, 2001, 11:44 PM
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.

Jan 18th, 2001, 04:08 AM
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,
:o Mac :)

barryooi
Jan 18th, 2001, 04:18 AM
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.