ah forgot second Keywords ala
Keywords LIKE '*news*' AND LIKE '*agriculture*'
should be
Keywords LIKE '*news*' AND Keywords LIKE '*agriculture*'
^^^^^^^^^^^
add this
On Apr 4, 2005 1:03 AM, flor bamboo <[EMAIL PROTECTED]> wrote:
> Yes, sir, it is in Access. But the problem remains.
> Please notice the additional single quote at the end
> of the error report:
>
> Error Type:
> Microsoft JET Database Engine (0x80040E14)
> Syntax error (missing operator) in query expression
> 'Keywords LIKE '*news*' AND LIKE '*agriculture*''.
>
> I'm sure I have no extra single nor double quote at my
> sql statement, and i can't locate where it's coming
> from.
>
>
> --- Charles Carroll <[EMAIL PROTECTED]> wrote:
> > SELECT * FROM articles WHERE Keywords LIKE
> > '%agriculture%' AND LIKE '%news%' ORDER BY
> > ArticleDate, DESC
> >
> > ah in Access it is a * not a %
> >
> > SELECT * FROM articles WHERE Keywords LIKE
> > '*agriculture*' AND LIKE '*news*' ORDER BY
> > ArticleDate, DESC
> >
> > would be correct I believe.
>
>
> >
> > On Apr 3, 2005 10:55 PM, flor bamboo
> > <[EMAIL PROTECTED]> wrote:
> > > This is the sql statement that came out:
> > >
> > > SELECT * FROM articles WHERE Keywords LIKE
> > > '%agriculture%' AND LIKE '%news%' ORDER BY
> > ArticleDate
> > > DESC
> > >
> > >
> > >
> > > --- Charles Carroll <[EMAIL PROTECTED]> wrote:
> > > > You must tell us the exact SQL that occured
> > after
> > > > the IFs and etc. ran
> > > > by response.writing it ala
> > > > http://www.learnasp.com/learn/sqlwrite.asp
> > > > Tell us what the full string is that it was
> > getting
> > > > error on.
> > > >
> > > > On Apr 3, 2005 10:07 PM, floorbamboo
> > > > <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > i'm trying to build a search engine that
> > seeks
> > > > keywords from the DB.
> > > > > When i enter just one word, this script
> > works
> > > > fine, but when i enter
> > > > > two or more words, i get a syntax error. pls
> > help
> > > > me correct this
> > > > > script.
> > > > >
> > > > > For i = 1 to WordCounter
> > > > > If SType = "AllWords" Then
> > > > > If i <> WordCounter Then
> > > > > strSQL1 = strSQL1 & " LIKE '%" &
> > Word(i) &
> > > > "%' AND "
> > > > > ElseIf i = WordCounter Then
> > > > > strSQL1 = strSQL1 & " LIKE '%" &
> > Word(i) &
> > > > "%' "
> > > > > End If
> > > > > ElseIf SType = "AnyWord" Then
> > > > > If i <> WordCounter Then
> > > > > strSQL1 = strSQL1 & " LIKE '%" &
> > Word(i) &
> > > > "%' OR "
> > > > > ElseIf i = WordCounter Then
> > > > > strSQL1 = strSQL1 & " LIKE '%" &
> > Word(i) &
> > > > "%' "
> > > > > End If
> > > > > End If
> > > > > Next
> > > > >
> > > > > strSQL = "SELECT * FROM articles WHERE
> > Keywords"
> > > > & strSQL1 & " ORDER
> > > > > BY ArticleDate DESC"
> > > > >
> > > > > When i use two or more words, i get this
> > error:
> > > > >
> > > > > Error Type:
> > > > > Microsoft JET Database Engine (0x80040E14)
> > > > > Syntax error (missing operator) in query
> > > > expression 'Keywords LIKE
> > > > > '%trade%' AND LIKE '%agriculture%''.
> > > > > /owinfs/tests/searchalltry.asp, line 175
> > > > >
> > > > >
> > > > > Thank you.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > > Yahoo! Groups Links
> > > > >
> > > > >
> > > > > To visit your group on the web, go to:
> > > > >
> > > >
> > >
> >
> http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
> > > > >
> > > > > To unsubscribe from this group, send an email
> > to:
> > > > >
> > > >
> > >
> >
> [EMAIL PROTECTED]
> > > > >
> > > > > Your use of Yahoo! Groups is subject to the
> > Yahoo!
> > > > Terms of Service.
> > > >
> > >
> > >
> >
> ________________________________________________________________________
> > > Yahoo! Messenger - Communicate instantly..."Ping"
> >
> > > your friends today! Download Messenger Now
> > > http://uk.messenger.yahoo.com/download/index.html
> > >
> > >
> > > ________________________________
> > > Yahoo! Groups Links
> > >
> > >
> > > To visit your group on the web, go to:
> > >
> >
> http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
> > >
> > > To unsubscribe from this group, send an email to:
> > >
> >
> [EMAIL PROTECTED]
> > >
> > > Your use of Yahoo! Groups is subject to the Yahoo!
> > Terms of Service.
> >
>
> ________________________________________________________________________
> Yahoo! Messenger - Communicate instantly..."Ping"
> your friends today! Download Messenger Now
> http://uk.messenger.yahoo.com/download/index.html
>
>
> ________________________________
> Yahoo! Groups Links
>
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
>
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/