Dynamic SQL statement - Selection based on selection

D

DoctorG

I have an Access database with 1 significant (for this post) field - country
- and a few others. I need to code into an ASP the following :

1) The visitor clicks on a combo box where they must select a country
2) The code executes an SQL on the mdb and selects all unique countries,
which it displays in the combo box
3) Following the users's selection of a country, the code must pass this
parameter to a second SQL statement which will subsequently select all
records matching this country.
4) The result of this 2nd SQL will be processed further.

Can someone help with the 2 SQL codings, the combo box and especially the
parameter passing from the combo box to the 2nd SQL?

Thanks in advance
 
M

MD Websunlimited

Hi DoctorG,

You don't mention how many pages are involved here.

1 and 2 make no sense. In 1 the visitor is selecting a country from a combo box of counties, are they not already unique? If so,
then what is the purpose of 2

To accomplish 3 you'd use a FP SQL statement of the form SELECT * FROM COUNTRIES WHERE idCountry = ::idcountry::;
idcountry will be replaced with the value of form field idcountry, e.g.

<select name="idcountry">
<option value="22"> USA </option>
<option vlaue="23"> Germany </option>
</select>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top