|
-
Jul 5th, 2000, 03:42 PM
#1
Thread Starter
Addicted Member
I would like to query a search using SQL and ASP. The user would select a name from a dropdown box which would retrieve the desired results. I would need the code to fill drop down box with names from table and upon click to execute query. This is what I have so far that retrieves the basic. Any help in improving would be appreciated. Thanks.
<HTML>
<!--#INCLUDE FILE="RECTOTABLE.ASP" -->
<% ' -- Get a Recordset Object
Set MyRecordsetObject = Server.CreateObject("ADODB.Recordset")
' -- Retrieve the database information
MyRecordsetObject.Open "SELECT * FROM ACT_1 WHERE NAME = 'LFDIV' or name = 'nansh.tpc' and account = 'ret_prem_g'", "DSN=DB1" %>
<table> <%
' -- Loop through the employee records in the Recordset Object until End Of File
Do While Not MyRecordsetObject.EOF
%>
<tr>
<td><%=MyRecordsetObject("Name") %></td>
<td><%=MyRecordsetObject("ACCOUNT") %></td>
<td><%=MyRecordsetObject("QTR1") %></td>
<td><%=MyRecordsetObject("QTR2") %></td>
</tr>
<%
' -- Move to next employee record
MyRecordsetObject.MoveNext
' -- Continue looping
Loop
%>
</table>
%>
<%
MYRECORDSETOBJECT.Close
Set MyRecordsetObject = Nothing
%>
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
|