Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching all fields in a database
Message
From
15/11/1996 01:28:46
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00012278
Message ID:
00012316
Views:
34
>
>MyString=create_string('m.field1','m.field2',etc...)
>
>IF .NOT. EMPTY(MyString)
> SELECT * FROM my_table ;
> WHERE &MyString ;
> INTO CURSOR MyCursor
>ELSE
> =msgbox('Invalid Criteria',"",16)
> RETURN
>ENDIF
> Example, if m.field1='Orange' and m.field is empty and
>m.field3=4, create_string will return me this:
>
>ALLTRIM(UPPER('Orange')) $ ALLTRIM(UPPER(field1)) ;
>.AND. 4=field3
>

...Yep, that's what I started with too, until I discovered that
there is a limitation of the compillation string. Imagine
having more than 15 fields to search for :) IT WILL NOT
COMPILE!!! That's why I suggested to go the SEEK-route.
More efficient search, can be controlled by SET NEAR ON/OFF...
Let's say after unsuccessful search, if you want to terminate
it to pick up a range of values, and than go for precise
matching, etc...
Some things are better be left unknown...NOT!!!
Previous
Reply
Map
View

Click here to load this message in the networking platform