October 28th, 2003, 10:44 AM
Problem with CONTAINS and Free-text
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?