Forums

This topic is locked

Cant get SQL to search database??

Posted 10 Dec 2005 12:33:12
1
has voted
10 Dec 2005 12:33:12 Malcolm X posted:
Can anyone suggest whey I dont get any results with this search?

SQL reads:

SELECT SupplierName, Location, ShortDescription
FROM Query1
WHERE 'TimberSpecies' LIKE MMColParam AND 'CategoryTable' LIKE MMColParam2 AND 'Location' LIKE MMColParam3

MMColParam 1 Request.Form("keywordSearch"
MMColParam2 2 Request.Form("location"
MMColParam3 3 Request.Form("category"

Mally.

Replies

Replied 12 Dec 2005 15:09:15
12 Dec 2005 15:09:15 Vince Baker replied:
you have WHERE 'TimberSpecies' LIKE MMColParam, is this copied from your code or have you typed it?

not sure what you are trying to achieve from what you have coded...

Regards

Vince Baker
<strong>DMX Zone Manager</strong>

[VBScript | ASP | HTML | CSS | SQL | Oracle | AS400 | ERP Logic | Hosting]
Replied 13 Dec 2005 14:39:35
13 Dec 2005 14:39:35 Malcolm X replied:
I have a SQL error that I cant resolve here.

When testing the SQL quiry in MS Access it works fine.
When testing the SQL quiry in Dreamweaver Recordset I get the following error messsage

[Microsoft][ODBC Microsoft Access Driver] Invalid use of '.', '!', or '()' in query expression 'tblCategories.2 =tblResults.2'.

SQL Reads
SELECT tblResults.idSpecies, tblResults.idCategory, tblSuppliers.idLocation
FROM tblLocation INNER JOIN (tblSuppliers INNER JOIN (tblSpecies INNER JOIN (tblCategories INNER JOIN tblResults ON tblCategories.idCategory = tblResults.idCategory) ON tblSpecies.idSpecies = tblResults.idSpecies) ON tblSuppliers.idSupplier = tblResults.idSupplier) ON tblLocation.idLocation = tblSuppliers.idLocation
ORDER BY tblResults.idSpecies, tblResults.idCategory, tblSuppliers.idLocation;

Error message when searching the database once uploaded.
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'tblResults.spotted gum'.
/html/results.asp, line 55

Code reads
52 rsSearchResult.CursorType = 0
53 rsSearchResult.CursorLocation = 2
54 rsSearchResult.LockType = 1
55 rsSearchResult.Open()
56 rsSearchResult_numRows = 0

Any ideas ?

Reply to this topic