Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 12th, 2006, 03:54 AM
yts007 yts007 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 5 yts007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 21 m 19 sec
Reputation Power: 0
HELP with single quots double quotes

am getting this error message when running this statement in dreamweaver mx 2004:

Microsoft VBScript compilation (0x800A0408)
Invalid character

-------------------- the select statement ----------------

Recordset1.Source = "SELECT tblBooks.Title, tblBooks.No_pages, tblBooks.Price, tblBooks.Availability, tblBooks.AuthorName, tblBooks.Out_Of_List, tblBooks.Img_url, tblBookSizes.Size_Desc, tblAuthors.Author_Name, tblCategory.Category_Desc, tblEditions.Edition_Desc, tblPublishers.Publisher_Name, tblYears.Year_Desc FROM tblYears INNER JOIN (tblPublishers INNER JOIN (tblEditions INNER JOIN (tblCategory INNER JOIN (tblBookSizes INNER JOIN (tblAuthors INNER JOIN tblBooks ON tblAuthors.Author_id = tblBooks.Author_id) ON tblBookSizes.Size_no = tblBooks.Size_no) ON tblCategory.Category_id = tblBooks.Category_id) ON tblEditions.Edition_no = tblBooks.Edition_no) ON tblPublishers.Publisher_id = tblBooks.Publisher_id) ON tblYears.Year_id = tblBooks.Year_id WHERE (((tblBooks.Title) Like "%" + Replace(Recordset1__vtitle, "'", "''") + "%")) OR (((tblBooks.AuthorName) Like "%" + Replace(Recordset1__vauthorname, "'", "''") + "%"))"

------------------------------------------------

anybody can suggest a good artical, book, post that explain how to read, usage quotes. pls

Reply With Quote
  #2  
Old January 12th, 2006, 04:00 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 102109 Folding Title: Super Ultimate Folder - Level 1Folding Points: 102109 Folding Title: Super Ultimate Folder - Level 1Folding Points: 102109 Folding Title: Super Ultimate Folder - Level 1Folding Points: 102109 Folding Title: Super Ultimate Folder - Level 1Folding Points: 102109 Folding Title: Super Ultimate Folder - Level 1Folding Points: 102109 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
Hi,

w3schools.com is always a good resource.

you must use & to concatenate strings in VBScript,
this should be the correct syntax:
Code:
Recordset1.Source = "SELECT tblBooks.Title, tblBooks.No_pages, tblBooks.Price, tblBooks.Availability, tblBooks.AuthorName, tblBooks.Out_Of_List, tblBooks.Img_url, tblBookSizes.Size_Desc, tblAuthors.Author_Name, tblCategory.Category_Desc, tblEditions.Edition_Desc, tblPublishers.Publisher_Name, tblYears.Year_Desc FROM tblYears INNER JOIN (tblPublishers INNER JOIN (tblEditions INNER JOIN (tblCategory INNER JOIN (tblBookSizes INNER JOIN (tblAuthors INNER JOIN tblBooks ON tblAuthors.Author_id = tblBooks.Author_id) ON tblBookSizes.Size_no = tblBooks.Size_no) ON tblCategory.Category_id = tblBooks.Category_id) ON tblEditions.Edition_no = tblBooks.Edition_no) ON tblPublishers.Publisher_id = tblBooks.Publisher_id) ON tblYears.Year_id = tblBooks.Year_id WHERE (((tblBooks.Title) Like '%" & Replace(Recordset1__vtitle, "'", "''") & "%')) OR (((tblBooks.AuthorName) Like '%" & Replace(Recordset1__vauthorname, "'", "''") & "%'))"

you want the sql to look similair to this

select * from table where field like '%something%'

so build it like this
Code:
something = "something"
sql = "select * from table where field like '%" & something &"%'"

and if you want it to look like this
select * from table where field like "%something%"
use "" like this
Code:
something = "something"
sql = "select * from table where field like ""%" & something & "%"""

hope this helps
__________________
Look! Its a ShemZilla



Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > HELP with single quots double quotes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT