• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1662
  • Last Modified:

ASP SQL - Microsoft OLE DB Provider for SQL Server error '80040e21'

Hi

I'm trying to select from a full text index table,  But when i add it to the asp page and execute I get the following error message

Microsoft OLE DB Provider for SQL Server error '80040e21'

The requested properties cannot be supported

can some please advice where I'm going wrong

<%Dim strProductID
strProductID = recordset1("makemodel")
%>
<%set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_example_STRING
Recordset2.Source = "SELECT product_name, FROM feed WHERE CONTAINS(product_name, '"+strProductID+"')"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 3
Recordset2.Open
Recordset2_numRows = 0
%>

Open in new window

0
sparky74
Asked:
sparky74
  • 3
  • 2
1 Solution
 
pivarCommented:
Hi,

There is a typo in the select statement, there shouldn't be a ','.

"SELECT product_name FROM feed WHERE CONTAINS(product_name, '"+strProductID+"')"

/peter
0
 
sparky74Author Commented:
Sorry Peter that was my mistake, I cut out a few other fields to post the statement and left the comma in by mistake

it still produces the same error though

0
 
sparky74Author Commented:
I have updated the following and the script seems to move on

Recordset2.CursorLocation = 1
Recordset2.LockType = 1

and now I get this error

Microsoft OLE DB Provider for SQL Server error '80040e14'

Syntax error occurred near 'Aqua'. Expected ''''' in search condition 'Fred Aqua FV5260'.

0
 
pivarCommented:
In your searchcondition in CONTAINS you also need to encapsulate the words with citationmarks ". Like this

"SELECT product_name FROM feed WHERE CONTAINS(product_name, '\""+strProductID+"\"')"
0
 
sparky74Author Commented:
Thanks Peter

I just got it with

WHERE CONTAINS(product_name, '"""+strProductID+"""')"

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!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now