补充一下:query_contract中的记录是用append的方法填加,然后让用户输入数据
解决方案 »
- 请问一下面试金融行业估计是炒股软件
- 怎么安装InfoPower组件?
- 散分...【分享贴】EaPopup提示窗口控件(附源码)
- 这回来这里送分给 delphi爱好者 有人要吗?
- 各位老大 你们是如何解决学习语言方面的问题的,如何让自已的知识面丰富的?
- 如何解决图片闪烁问题????
- TShiftState是集合类型,还是枚举类型,如果是集合为什么下的代码会错?
- 我是DELPHI那边的,用结构化存储文件时出错ole error 300800ff,请内行帮忙
- 最简单的问题:OLE的接口是怎么一回事?
- 关于update问题 先谢谢
- delphi6的价钱
- 谁能将.CPP文件的代码翻译成DELPHI语言??
有问题
use other ttable replace Query_contract
with mysql do
begin
databasename:=Yourdatabasename;
end;
try
Query_contract.First;
//Query_contract.Bof
while not Query_contract.Eof do
begin
with mysql do
begin
close;
sql.clear;
sql.add(format('select user_id from yourtablename where userid=''%s'',[DBE_user_id.Text]));
open;
if_located:=not (bof and eof);
end;
if if_located then
begin
if (Query_contract.FieldByName('service_id').Text = '') or
(Query_contract.FieldByName('service_number').Text = '') or
(Query_contract.FieldByName('ratio').Text = '') then
begin
ShowMessage('表中有数据为空!');
break;
end;
end; Query_contract.Next;
end; except end;
if_located := Query_contract.Locate('user_id', DBE_user_id.Text, []);
except
end;真是胡闹!!!
我帮你改改,但只是一种提示性的:
Query_contract.GetBook(myBook);//请先把当前记录的位置记下来。
try
try
if_located := Query_contract.Locate('user_id', DBE_user_id.Text, []);
//这一句将可能会改变当前记录的位置,比如又移到第一条,那么先生,这会导致死循环的。
except
end;
finally
Query_contract.GotoBook(myBook);
//为了避免当前记录位置被改,请把先前保存的位置还原回去。
end;
这里:if_located := Query_contract.Locate('user_id', DBE_user_id.Text, []);