[By the waves (Dayichen@163.com) at: 2005.01.07] 874 9CBS blog server, always error. Write a half-day article forgot COPY, and the result pos-> error-> over. I'm furious. Almost spit all the fish pills sprayed by Auntie. The lunch break is gone, and the mood is gone. I will make a simple, probably say some places that need to be paying attention to the multi-column query.
WITH CustTable Do Locate ('Company; Contact; Phone ", Vararrayof ([' Sight Diver ',' P ',' 408-431-1000 ']), [loPartialKey]);
1. Use ";" to divide multiple field names, use varRayof () to deliver multiple positioning values. 2, the field must be exactly the same as the database, even if you are used to space. Although the program looks clear, Locate will not do TRIM yourself, so it uses spaces to be part of the field name. 3. Because the positioning value is Variants, the positioning is not known to the string. 4. For the result of the multi-column query, you must all the columns all the characters and can you, as long as there is a column, it will return false. 5. It is best not to position the null value, which will carry out traversal from beginning to tail, affecting speed.
OK, about the usage of Locate, it is said to write a small example as a summary.
var LocateSuccess: Boolean; SearchOptions: TLocateOptions; StrField, StrLocate: String; // name field, targeting value begin SearchOptions: = [loCasesensitive, loPartialKey]; LocateSuccess: = CustTable.Locate (StrField, StrLocate, SearchOptions); end; OF Blog : Http://blog.9cbs.neet/walkingboy/