with ADOTable1 do
begin
if locate('name',LabeledEdit1.Text,lo) then
showMessage('查找成功!')
else
showMessage('查找失败')
end;本人运行此代码老是这个错误:[Error] locat_guest.pas(51): '(' expected but ')' found
应如何修改啊
begin
if locate('name',LabeledEdit1.Text,lo) then
showMessage('查找成功!')
else
showMessage('查找失败')
end;本人运行此代码老是这个错误:[Error] locat_guest.pas(51): '(' expected but ')' found
应如何修改啊
解决方案 »
- 动态创建的Timage图片更换问题
- delphi如果从数据库读去图片,我做了整天都没做出来。
- 有关DevExpress组件的问题
- 如何让系统发出蜂鸣声
- 如何能使前一语句执行完后再执行下一语句
- 请问现在delphi最新版本时多少,到目前最好用得版本是哪一版?
- windows98是用什么语言写的?WIN API 是用什么语言写的?总不会是VC吧?
- 一个有关tadodataset保存的简单问题.不过困扰着我两天都吃不下饭了.请各位帮忙看看.
- 怎样在DBGrid中动态增加字段名?
- 请问单击托盘图标的消息是什么,如何截取之?
- 求教:截取屏幕问题
- 想跳槽,但如果因面试等频频请假似乎不太好,大家是怎么解决这个问题的?
with ADOTable1 do
begin
if locate('name',LabeledEdit1.Text,lo) then
showMessage('查找成功!')
else
showMessage('查找失败');
end;
Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '408-431-1000']), [loPartialKey]);
TLocateOptions Opts;
Opts.Clear();
Opts << loPartialKey;
Variant locvalues[2];
locvalues[0] = Variant("Sight Diver");
locvalues[1] = Variant("P");
CustTable->Locate("Company;Contact", VarArrayOf(locvalues, 1), Opts);Options is a set that optionally specifies additional search latitude when searching on string fields. If Options contains the loCaseInsensitive setting, then Locate ignores case when matching fields. If Options contains the loPartialKey setting, then Locate allows partial-string matching on strings in KeyValues. If Options is an empty set, or if the KeyFields property does not include any string fields, Options is ignored.Locate returns true if it finds a matching record, and makes that record the current one. Otherwise Locate returns false.Locate uses the fastest possible method to locate matching records. If the search fields in KeyFields are indexed and the index is compatible with the specified search options, Locate uses the index. Otherwise Locate creates a filter for the search.另外,楼主是你自己,不要搞混了
改成这样试试,我一直都这么用