?
Solved

Index Server and SQL

Posted on 2002-05-15
5
Medium Priority
?
338 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 800 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

Industry Leaders: 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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

770 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