kvd
05-16-2007, 04:40 PM
Hello!
I've been wristling with a problem in my website; it's asp with access database (mdb)
I have 2 tables
tblSchools
with:
schoolNr
schoolName
schoolAdress
schoolPostcode
tblClass
schoolNr
class (string with class name, like bussness, scientics, languages, sports, art, ...)
grade (integer with 1-3)
I get search form POST fields using asp's response object:
class = request.forms("txtGrade") = textfield to enter a classname
grade = request.forms("cmbGrade") = combobox with options 1,2,3,all
postcode = request.forms("txtPostcode") = textfield to enter postcode obious
I now want a recordset with the results from this search.
I make a new object cnnDB and connect with my db
I populate a recordset (ADODB) with a query
strSql= "Select schoolNr from tblClass where ucase(class) like '%" & Ucase(class) & "%' from tblClass"
Set rstClasses = cnnDB.execute (strSql)
Now I have a recordset with all the schoolNr's who have this class.
What i want is all the schools with the postcode = postcode searched
I can set another recordset like above with all the schools in this postcode
but how can I combine the results from these to recordsets, so that i have a recordset with only the schoolNr's who are in both recordsets??
Or schould i try another appraoch?
Hope i clearly describe my problem,
thank's in advance
greetz, KvD
I've been wristling with a problem in my website; it's asp with access database (mdb)
I have 2 tables
tblSchools
with:
schoolNr
schoolName
schoolAdress
schoolPostcode
tblClass
schoolNr
class (string with class name, like bussness, scientics, languages, sports, art, ...)
grade (integer with 1-3)
I get search form POST fields using asp's response object:
class = request.forms("txtGrade") = textfield to enter a classname
grade = request.forms("cmbGrade") = combobox with options 1,2,3,all
postcode = request.forms("txtPostcode") = textfield to enter postcode obious
I now want a recordset with the results from this search.
I make a new object cnnDB and connect with my db
I populate a recordset (ADODB) with a query
strSql= "Select schoolNr from tblClass where ucase(class) like '%" & Ucase(class) & "%' from tblClass"
Set rstClasses = cnnDB.execute (strSql)
Now I have a recordset with all the schoolNr's who have this class.
What i want is all the schools with the postcode = postcode searched
I can set another recordset like above with all the schools in this postcode
but how can I combine the results from these to recordsets, so that i have a recordset with only the schoolNr's who are in both recordsets??
Or schould i try another appraoch?
Hope i clearly describe my problem,
thank's in advance
greetz, KvD