 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

December 9th, 2005, 03:50 AM
|
|
Authorized User
|
|
Join Date: Aug 2005
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
SQL HELP
Hey to Imar & all.
I have played around with SQL and so far have not been successfull.
Can anyone suggest or post what my SQL statment should read.
I have included the following information.
Database Name: datab.mdb
Table Name: tblQuery1
Column Names: name
location
description
Recordset Name: redord1
Results Page Name: result.asp
Search Page Name: search.asp
Search Page Filed Names:
Textfield: keywordSearch
List/Menu: category
List/Menu: location
If I have left anything out please ask me.
Thanks for all your help.
Mally.
|
|

December 9th, 2005, 06:06 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Mally,
I am not sure what you're asking here. What are you trying to accomplish?
What kind of answer are you looking for?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

December 9th, 2005, 06:09 AM
|
|
Authorized User
|
|
Join Date: Aug 2005
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Trying to created an advanced recordset so that when you search it searches using the three fields that are in the search page.
Im not sure how to create the SQL manualy.
|
|

December 9th, 2005, 06:28 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Are you aware of the keyword LIKE in T-SQL? With LIKE you can search a column for part of a string:
SELECT Name FROM tblQuery1 WHERE Name LIKE '%mal%'
will find all records with mal in it, including mally etc.
The % works as a wildcard, so when you leave out one of the two, the column should either start or end with the text you're searching for.
Does this help?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

December 9th, 2005, 07:55 AM
|
|
Authorized User
|
|
Join Date: Aug 2005
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I get the general meaning of that. Trying to delete an existing recordset, but every time I click on the minus symbol at the top it dose not delete the recordset. Any ideas why?
|
|

December 9th, 2005, 08:51 AM
|
|
Authorized User
|
|
Join Date: Aug 2005
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Its ok, the recordset has been deleted. I think my problem may be the database.
When in Dreamweaver, testing a recordset. In the filter section there are several fields. A few of them work when you test them. Most of them come up with an error message.
[Microsoft][ODBC Microsoft Access Driver]Syntax error(missing operator)in query expression 'Street address = "".
This only comes up on some of the fields. Do you know what may be causing this?
Mally.
|
|

December 9th, 2005, 09:08 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
How does the entire query look like? Maybe the error message is right, and there is an error in the SQL statement....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

December 9th, 2005, 09:54 AM
|
|
Authorized User
|
|
Join Date: Aug 2005
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Do you mean the query in Access? or this one in SQL
This did not work when testing
SELECT *
FROM Query1
WHERE Timber Species LIKE '%MMColParam%'
MMColParam 1 Request.Form("keywordSearch")
This worked for some reason
SELECT *
FROM Query1
WHERE Location LIKE '%MMColParam%'
MMColParam 1 Request.Form("keywordSearch")
Mally.
|
|

December 9th, 2005, 09:58 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
It's because you have a space in the name of the column. This isn't recommended (for the reasons you just encountered) so it's best to rename the column to something like TimberSpecies.
Alternatively, wrap the column name in square brackets:
WHERE [Timber Species] LIKE bla bla bla.
Is this query the problem you contacted me about earlier?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

December 9th, 2005, 10:30 AM
|
|
Authorized User
|
|
Join Date: Aug 2005
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
This has fixed part of the problem, the error message that used to come up every time Id test the recordset,.
So with this SQL thanks Imar, I can now search on the search page using one text field.
To create the advanced SQL so that the other two List/Menu work in the same search, should I do similart or add to this SQL?
SELECT *
FROM Query1
WHERE TimberSpecies LIKE '%MMColParam%'
MMColParam 1 Request.Form("keywordSearch")
Mally
|
|
 |