locate怎样实现模糊查找?

hansonboy 2002-08-01 09:41:27
如题
...全文
85 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
hansonboy 2002-08-01
  • 打赏
  • 举报
回复
用户SQL查找速度太慢,用locate怎样实现呀?hezchuan168:可以给点代码吗看看吗?
hezchuan168 2002-08-01
  • 打赏
  • 举报
回复
我以前做过这个方面东东,很容易的,你定义个参数就行的了
neilwq 2002-08-01
  • 打赏
  • 举报
回复
用lopartialkey只能开头的字符的模糊查找,要中间字符的模糊查找可以用sql
语句
renzhm 2002-08-01
  • 打赏
  • 举报
回复
Delphi中的帮助很详细,看看吧!:)
yangyugw 2002-08-01
  • 打赏
  • 举报
回复
那个软件你看到有中间字符模糊了
自己一个一个的查找,算法要好。

************
* 努力学习 *
* 全为 *
*¥人民币¥*
************

hansonboy 2002-08-01
  • 打赏
  • 举报
回复
我用lopartialkey这个参数只能开头的字符的模糊查找,却不能实现中间字符的模查找
日总是我哥 2002-08-01
  • 打赏
  • 举报
回复
Implements a virtual method for searching a dataset for a specified record and makes that record the active record.

function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions
): Boolean; virtual;

Description

This function returns False, indicating that a matching record was not found and the cursor is not repositioned.

Descendant classes override this method so that it locates the record where the fields identified by the comma-delimited string KeyFields have the values specified by the Variant or Variant array KeyValues. Options indicates whether the search is case insensitive and whether partial matches are supported. Locate should return True if a record is found that matches the specified criteria and the cursor repositioned to that record.

TLocateOptions defines the values for the Options parameter of the Locate method of TTable, TQuery, and TStoredProc.

Unit

DB

type
TLocateOption = (loCaseInsensitive, loPartialKey);
TLocateOptions = set of TLocateOption;

Description

The TLocateOptions type defines the possible values for the Options parameter of the Locate method of the TTable, TQuery, and TStoredProc components, as described in the following table:

Value Description

loCaseInsensitive Key fields and key values are matched without regard to case.
loPartialKey Key values can include only part of the matching key field value; for example, 'HAM' would match both 'HAMM' and 'HAMMER.'
hansonboy 2002-08-01
  • 打赏
  • 举报
回复
up.
hansonboy 2002-08-01
  • 打赏
  • 举报
回复
没人知道吗?
hansonboy 2002-08-01
  • 打赏
  • 举报
回复
帮一下忙吧?
Venidelphi 2002-08-01
  • 打赏
  • 举报
回复
up..
hansonboy 2002-08-01
  • 打赏
  • 举报
回复
up..

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧