PDA

View Full Version : Simple SQL Recordset in DW8 - Search Page


djmarkymark
04-16-2007, 01:16 AM
Hi

I used to have a search page on my web that allowed you to search my Access database e.g. surname

I had code like:
SELECT surname, firstname, studio
FROM tblEmployees
WHERE surname = vsurname

I set up variable called vsurname which refers to the Request.Form("fldSurname") field that I named on the form.
this works fine - although im confused as i used to have in MX '%vsurname%' etc.. and used the word LIKE instead of =, but it seems to work without these???? WHY??

What i would like is for the user to type either first OR surname in a field to search the database.

I tried this:
SELECT surname, firstname, studio
FROM tblEmployees
WHERE surname = vsurname OR firstname = vsurname

This does not work, any ideas.. Im using DW8.02, IIS, Access 2003. I've tried various things to no avail. Any suggestions much appreciated!
thanks