|
-
Jan 17th, 2001, 11:29 PM
#1
Thread Starter
New Member
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 18th, 2001, 12:09 AM
#2
<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
-
Jan 18th, 2001, 12:44 AM
#3
Thread Starter
New Member
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, 05:08 AM
#4
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 
-
Jan 18th, 2001, 05:18 AM
#5
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|