|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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 ![]() ![]()
|
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > HELP with single quots double quotes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|