
October 28th, 2003, 09:44 AM
|
|
Junior Member
|
|
Join Date: Aug 2003
Posts: 19
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Problem with CONTAINS and Free-text
Hiya,
I'm trying to use the following to search 4 fields in total, 2 in one table two in another and return them as one recordset.
strSQL = "SELECT id, tableID, tagline, content FROM tblNews WHERE CONTAINS (tagline, '" & searchString & "') OR CONTAINS (content, '%" & searchString & "%') UNION ALL SELECT id, tableID, tagline, content FROM tblDatabank WHERE CONTAINS (tagline, '" & searchString & "') OR CONTAINS (content, '" & searchString & "') ORDER BY id"
I get the following error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot use a CONTAINS or FREETEXT predicate on table 'tblNews' because it is not full-text indexed.
I'm sure if I sort that out it will give me the same error on tblDatabank. I've tried to FREETEXT enable both tables with Enterprise Manager on SQL Server 7.0, but when I right click the tables in question the "Full-text index table" options are all greyed out.
Where am I going wrong please?
|