PURPOSE: Trying to populate a list box with values from a database.
*I have a program I am playing with and the next step I am on now is building a list box with the values from my table. i.e.: I want to implement all items in the list box, so that the user may perform queries off of the values found. i.e. go on table called Employees" I have a field in the Customers1 table named City.... so I'm trying to get all the cities of the customers into a listbox (without duplicates).
Thanks for all your time and patience, have a great day!
...>>>code<<<...
unction QueryCityResults()
rs.open "SELECT * " & _
"FROM EMPLOYEES" _
,ConnectionString
out = ""
If Not rs.EOF Then
'out = out & "<TR>" & vbCrLf
For i = 0 To rs.Fields.Count - 1
out = out & "<TD class=""header"">" & _
rs.Fields(i).name & _
"</TD>" & vbCrLf
Next
'out = out & "</TR>" & vbCrLf
End If
...>>>code<<<...
...>>>code<<<...
That's the function and here is where I am calling it:
<%
If strCityName ="Midway Park" Then
%>
<HTML>
<HEAD>
<TITLE>Upload Table CUSTOMERS</TITLE>
<style>
.header {
font: bold 12pt sans-serif;
color: purple;
}
td {
font: 10pt sans-serif;
color: blue;
}
</style>
</HEAD>
<H1>VIEWING CUSTOMERS LIVING IN MIDWAY PARK</H1>
<BODY>
<P>
<FORM NAME = "frmClick" ACTION="Tables2.asp">
<INPUT TYPE="SUBMIT" NAME="CHOOSE" VALUE="CHANGE TABLE" onClick = "Tables2.asp">
</FORM>
<FORM NAME = "frmClick" ACTION="insertcust.asp">
<INPUT TYPE="SUBMIT" NAME="CHOOSE" VALUE="INSERT CUSTOMER" onClick = "insertcust.asp">
</FORM>
<FORM NAME = "frmClick" ACTION="custdeletecustid.asp">
<INPUT TYPE="SUBMIT" NAME="CHOOSE" VALUE="DELETE CUSTOMER" onClick = "custdeletecustid.asp">
</FORM>
<FORM NAME = "frmClick" ACTION="performquery.asp">
<INPUT TYPE="SUBMIT" NAME="CHOOSE" VALUE="PERFORM QUERY" onClick = "performquery.asp">
</FORM>
<table border="1">
<%= GetCustomerCity %>
</table>
</BODY>
</HTML>
<%
End If
%>
Here is the ERROR msg:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/tburgess2/viewbycustid.asp, line 34, column 14
"WHERE (CITY="Midway Park")" _
-------------^
And I'm not sure what's wrong with that line, I've tried changing it several different times to no avail. But even when I get it to working it still only shows one field value in the options select.
Toni Burgess
misskaos99@yahoo.com