Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making freetext querys to MSSQL
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Making freetext querys to MSSQL
Miscellaneous
Thread ID:
00544095
Message ID:
00544095
Views:
51
Hallo
I have a question about making SQL-queries to a MS server.
The user has a form with 30 fields, where he can put free text in, as he want, in 1, 2… or all fields.
If I only had one field, I could have build the query like this, and it works perfect:
***
Par=”%some letters%”
=SQLEXEC(MyConnection, "SELECT * FROM MyTable WHERE PATINDEX(?Par,Field1)<>0","Result")
***
BUT. How do I build the query if I want to search throw 2-30 different fields, with an AND between every “PATINDEX”?
I don’t know from the beginning witch fields, or how many fields the user will put text in.
In FoxPro I could build the WHERE-clause as a macro, but it is not a good solution in this case
(I have no full-text index on the database, and I’m using VFP6).

I hope you understand my question
Thanks in advance
/Kjell
Next
Reply
Map
View

Click here to load this message in the networking platform