数据库中有记录但为什么却找不到

bullHEcow 2003-08-21 09:21:41
表 有索引

Table1->editKey();
Table1->FieldByName()->AsString = 我的字段
bool success = Table1->GotoKey();

success 有时候为 false; 有时候又为 true;

真的不知这是咋会事,还请大家多提提
...全文
58 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
bullHEcow 2003-09-25
  • 打赏
  • 举报
回复
怎么没人 来啊
bullHEcow 2003-09-24
  • 打赏
  • 举报
回复
而且
setKey()与EditKey()
有区别吗?
bullHEcow 2003-09-24
  • 打赏
  • 举报
回复
我是一开始就指定的,在Table的IndexFieldNames属性里指定
难道不行吗,而且,查找的也是IndexFieldNames属性里指定
的字段
guanshangming 2003-09-23
  • 打赏
  • 举报
回复
Table1->Close();
Table1->IndexFieldNames="Company";
Table1->Open();
Table1->SetKey();
Table1Company->Value=Edit1->Text;
if(!Table1->GotoKey()) ShowMessage("Not Found!");

1.打开文件时必须同时指定索引
2.查找的值与索引值完全相同
bullHEcow 2003-09-23
  • 打赏
  • 举报
回复
实在是没人
回答,所以不得不令寻门道,愿有所改善
bullHEcow 2003-09-22
  • 打赏
  • 举报
回复
快上啊,贴了这么长时间了
还没有一个满意的 答案
怎么结贴啊
bullHEcow 2003-08-25
  • 打赏
  • 举报
回复
上面不是说了有索引
Dala 2003-08-22
  • 打赏
  • 举报
回复
Table1->First();
Table1->SetKey();
Table1->FieldByName("Name")->AsString = "我的字段";
bool success = Table1->GotoKey();

lanchong781126 2003-08-22
  • 打赏
  • 举报
回复
mark
sunliwen780502 2003-08-22
  • 打赏
  • 举报
回复
可能是没有设置索引
Table1->First();
bool success;
TLocateOptions Opt;
Opt<<loPartialKey;
success=Table1->Locate("字段名",“字段值”,Opt);
swites 2003-08-21
  • 打赏
  • 举报
回复
用下面方法

Table1->First();
Table1->FieldByName()->AsString = 我的字段
bool success = Table1->GotoKey();

1,178

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 数据库及相关技术
社区管理员
  • 数据库及相关技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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