function TDataControl.Refresh(DS:TDataSet):Boolean;
var
bRetVal:Boolean;
//SavePlace:TBook;
begin
try
begin
bRetVal:=false;
DS.DisableControls;
DS.Close;
DS.Open;
DS.EnableControls;
end;
Except on E:EOleException do
begin
if E.ErrorCode=-2147217906 then
bRetVal:=true;
DS.EnableControls;
result:= bRetVal;
end; bRetVal:=true;
result:= bRetVal;
end;
end;
错误是:
[Error] uDataControl.pas(871): 'END' expected but identifier 'bRetVal' found
[Error] uDataControl.pas(874): '.' expected but ';' found
var
bRetVal:Boolean;
//SavePlace:TBook;
begin
try
begin
bRetVal:=false;
DS.DisableControls;
DS.Close;
DS.Open;
DS.EnableControls;
end;
Except on E:EOleException do
begin
if E.ErrorCode=-2147217906 then
bRetVal:=true;
DS.EnableControls;
result:= bRetVal;
end; bRetVal:=true;
result:= bRetVal;
end;
end;
错误是:
[Error] uDataControl.pas(871): 'END' expected but identifier 'bRetVal' found
[Error] uDataControl.pas(874): '.' expected but ';' found
begin
bRetVal:=false;
DS.DisableControls;
DS.Close;
DS.Open;
DS.EnableControls;
end;
改为
try
bRetVal:=false;
DS.DisableControls;
DS.Close;
DS.Open;
DS.EnableControls;
bRetVal:Boolean;
//SavePlace:TBook;
begin
try
bRetVal:=false;
DS.DisableControls;
DS.Close;
DS.Open;
DS.EnableControls;
except
on E:EOleException do
begin
if E.ErrorCode=-2147217906 then
bRetVal:=true;
DS.EnableControls;
result:= bRetVal;
end;
end; bRetVal:=true;
result:= bRetVal;
end;