Solved

Index Server and SQL

Posted on 2002-05-15
5
328 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Select2 jquery help 9 100
JS does not refresh 6 40
ASP exit 10 28
Replace value 2 35
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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