起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 183|回复: 4

[搞定]DataSet.Locate()函数的意思?**

[复制链接]
发表于 2007-10-17 14:58:31 | 显示全部楼层 |阅读模式
dsbDetail1.DataSet.Locate('FDealPerson;FDealStep',Variants.VarArrayOf([lDealPerson,'审核意见']),[])   函数的意思?
回复

使用道具 举报

发表于 2007-10-17 15:06:17 | 显示全部楼层
定位记录。 用2个字段值
回复 支持 反对

使用道具 举报

发表于 2007-10-17 15:25:57 | 显示全部楼层
可以查delphi帮助
Implements a virtual method for searching a dataset for a specified record and making it the active record.

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

Description

This function

Checks whether the dataset is unidirectional, and if so, raises an EDatabaseError exception.
        Returns False, indicating that a matching record was not found and the active record was not changed.

Descendant classes that are not unidirectional override this method so that it locates the record where the fields identified by the semicolon-separated list of fields in 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 returns True if a record is found that matches the specified criteria and that record is now active.
回复 支持 反对

使用道具 举报

发表于 2007-10-17 15:26:00 | 显示全部楼层
Locate需要传递三个参数,第一个是KeyFields参数,用于指定要按哪些字段搜索,第二个是KeyValues参数,用于指定每个字段相应的值,第三个是Options参数,用于设置搜索选项。

这句话的意思是:
无条件搜索字段'FDealPerson;FDealStep'为Variants.VarArrayOf([lDealPerson,'审核意见'])的记录,并将当前记录定位至该记录
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-10-17 16:58:20 | 显示全部楼层
谢谢!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-6-28 20:22 , Processed in 0.039203 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表