利用FindKey()来查找,为什么会出错?(20分)

C

cjh_xf

Unregistered / Unconfirmed
GUEST, unregistred user!
本人乃数据库新手,故所问问题比较浅显。我编写了一个查找程序,利用FindKey来查找,
可是总是出现错误提示:Constants cannot be used as open array arguments 是不是因为
我没有建立索引?可是,我已经在IndexName中指定某个字段为索引,还是不行呀!
不知何故!望大侠伸手,谢谢!
 
记不太清了

FindKey()必须在指定索引的字段中 查找
For SQL tables, the key may correspond to a specified index in IndexName, or to a list of field names in the IndexFieldNames property.
 
和和,使用Locate好了,比较简单,不需要索引
Locate('fld1;fld2',vararrayof(['string',1]),[locaseinsensitive])
 
使用FindKey方法搜索和定位记录一般为以下几个步骤:
1、设置IndexName属性指定要使用的索引,而对SQL数据库来讲需要设置
IndexFieldNames属性。当然,如果你使用表本身的主索引,可以不设置这个属性。
2、打开表。
3、Table1.Findkey(['1001-1'])。
 
接受答案了.
 
顶部