Solved

Index Server and SQL

Posted on 2002-05-15
5
295 Views
Last Modified: 2008-03-10
NT4/SP6a/IIS4/Index Server 2

Trying to query the Index Server using SQL like:

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "provider=msidxs;data source=thisWeb;"
SQL = "Select DocTitle, vpath, size from Scope('" + chr(34) + "\thisWeb" + chr(34) + "') WHERE CONTAINS('ASP')"
Set rs = Conn.Execute(SQL)

and it ain't working.

Gives
Microsoft OLE DB Provider for Microsoft Index Server error '80040e14'

Incorrect syntax near <end of input>. Expected '>'. SQLSTATE=42000

0
Comment
Question by:JOK
  • 3
  • 2
5 Comments
 
LVL 18

Expert Comment

by:bruno
ID: 7012731
umm...this is a guess, but give it a shot...think we had this problem too...

forget my reasoning, but i have this in my code....so not sure if this was part of the problem.  try adding the extra "> 0" at the end as shown below...


SQL = "Select DocTitle, vpath, size from Scope('" + chr(34) + "\thisWeb" + chr(34) + "') WHERE CONTAINS('ASP') > 0"


BRUNO
0
 
LVL 18

Accepted Solution

by:
bruno earned 200 total points
ID: 7012732
that should all be one line...don't think it came out that way?


SQL = "Select DocTitle, vpath, size from Scope('" + chr(34) + "\thisWeb" + chr(34) + "') WHERE CONTAINS('ASP') > 0"
0
 
LVL 3

Author Comment

by:JOK
ID: 7013588
I got it fixed. Not sure what the problem was, 'tho.

Ended up hardcoding the path like
SQL = "select characterization,docTitle,VPATH,rank from scope('Deep traversal of ""e:\foldera\docs""') where Contains(Contents," & thisSearchTerm & ")>0 order by Rank DESC"

and prior to that
thisTerm = Request.Form("searchterm")
thisSearchTerm = chr(39) & chr(34) & thisTerm & chr(34) & chr(39)
0
 
LVL 18

Expert Comment

by:bruno
ID: 7013685
so you did throw in the " > 0"?

regardless, glad you got it working.  :-)


BRUNO
0
 
LVL 3

Author Comment

by:JOK
ID: 7014072
got PART of it working, so I'm okay.

Trying to do it to a different folder and its giving me exception errors. Geez.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now