Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Can't Use Apostrophe In Search
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

leatherlips
Senior Member

USA
1838 Posts

Posted - 16 May 2008 :  22:33:17  Show Profile  Visit leatherlips's Homepage
I installed the search log mod and now get the following error whenever I use a search that includes a word with an apostrohpe in it (the word in red is my search term):

Syntax error (missing operator) in query expression 'SLK_KEYWORD='can't''.

/forum/inc_searchlog.asp, line 48

Here is line 48 (in green) and the surrounding lines in inc_searchlog.asp:

Sub AddKeywordsToDB()
Dim keywords, keycnt, rs_keyword, tempID
keywords = split(Request.Form("Search"), " ")
keycnt = ubound(keywords)
for i = 0 to keycnt
strsql = "SELECT SLK_ID FROM " & strTablePrefix & "SEARCHLOG_KEYWORDS WHERE SLK_KEYWORD='" & keywords(i) & "'"
Set rs_keyword = my_conn.execute(strsql)
If rs_keyword.EOF Or rs_keyword.BOF Then
rs_keyword.Close
Set rs_keyword = nothing
strsql = "INSERT INTO " & strTablePrefix & "SEARCHLOG_KEYWORDS (SLK_KEYWORD, SLK_COUNT) VALUES ('" & Left(keywords(i),255) & "', 1)"
my_conn.Execute (strsql),,adCmdText + adExecuteNoRecords
Else

What is the way to fix this?<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

phy1729
Average Member

USA
589 Posts

Posted - 16 May 2008 :  22:52:12  Show Profile
It works here. I think your missing a ckstr somewhere.<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 17 May 2008 :  03:47:51  Show Profile
Like Leatherlips, I get the same error
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'SLK_KEYWORD='can't''.
/forum/inc_searchlog.asp, line 57

<
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 17 May 2008 :  11:01:21  Show Profile
Try:

strsql = "SELECT SLK_ID FROM " & strTablePrefix & "SEARCHLOG_KEYWORDS WHERE SLK_KEYWORD='" & chkString(keywords(i),"SQLString") & "'"
Set rs_keyword = my_conn.execute(strsql)
<
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 May 2008 :  11:17:48  Show Profile  Visit leatherlips's Homepage
Doing that causes another error.

Here is the inc_searchlog file in text format. Maybe by viewing the entire thing will shed some light.<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 17 May 2008 :  11:28:23  Show Profile
What is the error?
You'll need to change this line also

strsql = "INSERT INTO " & strTablePrefix & "SEARCHLOG_KEYWORDS (SLK_KEYWORD, SLK_COUNT) VALUES ('" & Left(chkString(keywords(i),"SQLString"),255) & "', 1)"
<

Edited by - phy1729 on 17 May 2008 11:32:29
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 17 May 2008 :  11:32:51  Show Profile
In AddQueriesToDB you will need to change

myquery = chkString(Request.Form("Search"),"SQLString")
<
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 May 2008 :  11:35:21  Show Profile  Visit leatherlips's Homepage
The other error says (my search term is being shown in green):

Syntax error (missing operator) in query expression ''don't', 1)'. 

/forum/inc_searchlog.asp, line 53


I went ahead and applied the changes to both lines of code and now I get a new error:

Syntax error (missing operator) in query expression 'SLQ_QUERY='don't''. 

/forum/inc_searchlog.asp, line 68

<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 17 May 2008 11:39:19
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 May 2008 :  11:38:53  Show Profile  Visit leatherlips's Homepage
I've now applied all of the changes you've suggested so far.

Now I no longer get any errors but I also do not get any search results for words with apostrophes.

We're getting closer. <

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 17 May 2008 :  11:54:16  Show Profile
Add a Response.Write strsql before each my_conn.execute(strsql) so we can see what the queries are. Are you sure there are results for can't?<
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 May 2008 :  13:10:54  Show Profile  Visit leatherlips's Homepage
There should be results for "can't". It's in a song title.

I added the Response.Write strsql as you said but I still do not get any results for words with apostrophes. Unless I didn't do it correctly.<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 May 2008 :  13:18:10  Show Profile  Visit leatherlips's Homepage
Here are some more details of what is going on.

If I search for can't then no results are found.

If I search for we do this all night as an exact phrase then it is found.

If I search for can't we do this all night as an exact phrase then it is found but the "quick look" icon does not work. The "quick look" was another mod I installed that allows the search term to appear in a pop up box in the found topics. I named it "quick look" but don't remember the real name of the mod.

<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 17 May 2008 13:18:54
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 17 May 2008 :  13:32:05  Show Profile
quote:
Originally posted by leatherlips

There should be results for "can't". It's in a song title.

I added the Response.Write strsql as you said but I still do not get any results for words with apostrophes. Unless I didn't do it correctly.


I want to have a look at what the sql was. So before each SomeVar=my_conn.execute(strsql) if you add Response.Write strsql it will output the sql query.

The can't can't we do this all night problem is interesting and some light may be shed on it by seeing the sql queries.

To fix quick look, please post the file that mod is contained in and if you remember the line numbers also.<
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 May 2008 :  16:04:59  Show Profile  Visit leatherlips's Homepage
The "quick look" or Search Terms MOD (as it is really called) is here at SnitzBitz:

http://www.snitzbitz.com/mods/details.asp?Version=All&mid=226

It modifies a few files.

Everything works perfectly except when searching a word with an apostrophe.<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 17 May 2008 16:05:41
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 17 May 2008 :  16:21:33  Show Profile  Visit leatherlips's Homepage
I have added the Response.Write strsql to three lines like this:

Line 59: Response.Write strsql my_conn.Execute (strsql),,adCmdText + adExecuteNoRecords

Line 73: Response.Write strsql my_conn.Execute (strsql),,adCmdText + adExecuteNoRecord

Line 79: Response.Write strsql my_conn.Execute (strsql),,adCmdText + adExecuteNoRecords

I don't know if this is what you meant. I now get the following error:
Expected end of statement 

/forum/inc_searchlog.asp, line 59 

Response.Write strsql my_conn.Execute (strsql),,adCmdText + adExecuteNoRecords
<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 17 May 2008 16:22:13
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 17 May 2008 :  17:10:54  Show Profile
phy1729
I have amended the inc_searchlog.asp as you have kindly suggested above, like leatherlips the error messages have disappeared but I get no results/No Matches Found.
I have added a reply to a thread today with the word can't in it, so I would hope the searchmod.asp will extract it..
regards andy<
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.24 seconds. Powered By: Snitz Forums 2000 Version 3.4.07