Solved

Index Server and SQL

Posted on 2002-05-15
5
337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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/…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

691 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