Skip to main content
Participating Frequently
February 24, 2010
Question

SQL query with AND or OR

  • February 24, 2010
  • 8 replies
  • 471 views

Hi,

I am trying to get a recordset that samples multiple columns of my Access database for filtering, rather than just one.  I looked at a few .asp websites and they say the query would be written like this:

SELECT SystemName, SystemCategory, Branch, Manufacturer

FROM UnmmannedAircraftSystems

WHERE Branch LIKE %MMColParam%

AND PerfSensorPayloads LIKE %MMColParam2%

ORDER BY SystemName ASC

but it never works.  The page fails on the server.  And I know this type of query works through straight .asp coding, but somehow the way Dreamweaver sets up the variables is killing it.

Anybody have an ideas?

MW

This topic is closed to new replies. Start a new post to keep the conversation going.

8 replies

Participating Frequently
February 24, 2010

>The page fails on the server.

Fails in what way? And you will need to include more code so we can see how the parameters are being populated.

AstroMarkAuthor
Participating Frequently
February 24, 2010

Instead of the recordset data loading in the table cell, I get this:

ADODB.Fields error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/Connections/MultipleRecordFilt.asp, line 203

MW

AstroMarkAuthor
Participating Frequently
February 24, 2010

The first page has a form with 2 select menus and a submit button.  Upon selection and submission, the action of the form loads the page that is currently failing.  The form variables are passed into the target page which attempts to create a record set that is filtered from the 2 previous select menu pages.  Here is a screencap from the 2nd page's Dreamweaver recordset: