I have a a telephone directory that is reading from an Oracle database. The table displays fine (so far my coding has worked)...I must tell you I'm a newbie at ASP.
Anyway, I want to be able to filter the table by section. Do I createa another recordset? Here's a sample of my code..
<%
Set OraDatabase = Server.CreateObject("ADODB.Connection")
OraDatabase.Open = "Provider=ORAOLEDB.Oracle;Data Source=test;User ID=test;Password=test;"
Set osRecordset = OraDatabase.Execute("SELECT EMPLOYEE, SECTION, LOCATION, PHONE_NUMBER phone from adm_test_phone_all")
Response.Write "<table border = 1 cellpadding = 4>"
Response.Write "<tr>"
For I = O to osRecordSet.Fields.Count - 1
Response.Write "<td><b><center>" & osRecordSet(I).Name & "</center></b></td>"
Next
Response.Write "</tr>"
Do While Not osRecordSet.EOF
Response.Write "<tr>"
For I = O to osRecordSet.Fields.Count - 1
Response.Write "<td>" & osRecordSet(I) & "</td>"
Next
Response.Write "</tr>"
osRecordSet.MoveNext
Loop
Response.Write "</table>"
osRecordSet.Close
OraDatabase.Close
%>
I would appreciate any help/tips. I am a user of Dreamweaver MX...I have tried using their tools but I can't get anything to dispaly within the list box.
Thanks.
I'm not sure I understand exactly what you are trying to accomplish.
A couple of things to begin:
You will need to add a WHERE clause to your SELECT statement.
Set up a variable to hold the value you want to use in that clause
For example,
SELECT EMPLOYEE, SECTION, LOCATION, PHONE_NUMBER phone from adm_test_phone_all WHERE SECTION = myVariable.
You can set these up in DW using Recordset under the Application tab.
Can you post all of your code?
painted