语句如下
with SubQuery do
begin
DatabaseName := MSG_DBName; //根据ID 到数据库中查找
Close;
SQL.Clear;
SQL.Add('select * from app_marriage');
SQL.Add(format('where id = %d',[myId])); Open;
end; if Eof then
begin // 没有记录 说明用户发送的ID不正确 Result := '对不起,您查询的ID不存在,暂时不能为您提供服务'; end
else
....在 if eof then 这一句报错
报错信息是
exception class EInOutError with message 'I/O error 6'.不知道是什么意思
请高手指教
with SubQuery do
begin
DatabaseName := MSG_DBName; //根据ID 到数据库中查找
Close;
SQL.Clear;
SQL.Add('select * from app_marriage');
SQL.Add(format('where id = %d',[myId])); Open;
end; if Eof then
begin // 没有记录 说明用户发送的ID不正确 Result := '对不起,您查询的ID不存在,暂时不能为您提供服务'; end
else
....在 if eof then 这一句报错
报错信息是
exception class EInOutError with message 'I/O error 6'.不知道是什么意思
请高手指教
begin
DatabaseName := MSG_DBName; //根据ID 到数据库中查找
Close;
SQL.Clear;
SQL.Add('select * from app_marriage ');
SQL.Add(format('where id = %d',[myId])); Open;
end;
加一个空格试验一下!可能是SQL语句的问题!看看吧!
begin
DatabaseName := MSG_DBName; //根据ID 到数据库中查找
Close;
SQL.Clear;
SQL.Add('select * from app_marriage');
SQL.Add(format('where id = %d',[myId])); Open;
if Eof then
begin // 没有记录 说明用户发送的ID不正确 Result := '对不起,您查询的ID不存在,暂时不能为您提供服务'; end
else
....
end;
SQL.Add(format('where id = %d',[myId]));
===
先把 format('where id = %d',[myId])放到一变量去,再SQL.Add看看如何