Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 9th, 2005, 03:50 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
Reply With Quote
  #2 (permalink)  
Old December 9th, 2005, 06:06 AM
Imar's Avatar
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.
Reply With Quote
  #3 (permalink)  
Old December 9th, 2005, 06:09 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #4 (permalink)  
Old December 9th, 2005, 06:28 AM
Imar's Avatar
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.
Reply With Quote
  #5 (permalink)  
Old December 9th, 2005, 07:55 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
Reply With Quote
  #6 (permalink)  
Old December 9th, 2005, 08:51 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.


Reply With Quote
  #7 (permalink)  
Old December 9th, 2005, 09:08 AM
Imar's Avatar
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.
Reply With Quote
  #8 (permalink)  
Old December 9th, 2005, 09:54 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #9 (permalink)  
Old December 9th, 2005, 09:58 AM
Imar's Avatar
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.
Reply With Quote
  #10 (permalink)  
Old December 9th, 2005, 10:30 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Run .sql Script file in MS SQL Server 2000? aarkaycee SQL Server 2000 5 October 12th, 2009 05:43 AM
creating ssis packagte for sql server to sql serer Laxmikant_it ASP.NET 3.5 Professionals 0 November 26th, 2008 12:23 AM
Converting from MS SQL 2005 to Sql Epress edition saif44 SQL Language 0 February 16th, 2007 04:17 PM
Failed to copy objects from SQL server to SQL Serv monfu SQL Server 2000 4 December 4th, 2005 05:54 PM
Move SQL DB from one sql to another sql server Israr SQL Server 2000 3 January 24th, 2005 02:13 PM



All times are GMT -4. The time now is 03:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.