delphi could not convert variant of type (null) into type (olestr)解决方法

delphi could not convert variant of type (null) into type (olestr)procedure TForm3.DBEdit1Change(Se

delphi could not convert variant of type (null) into type (olestr)
procedure TForm3.DBEdit1Change(Sender: TObject); //onchange事件
var
i:integer;
s:string;
xcom:tcomponent;
begin
for i := 2 to 20 do
begin
s:='edit'+inttostr(i);
xcom:=findcomponent(s);
if xcom<>nil then
begin
Tedit(xcom).Text:=ADOquery1.Fields[i-2].Value; //break 按了之后这一条被选中了。错了么?
end;

procedure TForm3.FormShow(Sender: TObject);
begin

ADOConnection1.Connected:=false; //连接,设置。
ADOConnection1.Connected:=true;

ADOQuery1.Connection:=adoconnection1;
ADOQuery1.SQL.Clear;
ADOQuery1.Close;
ADOQuery1.SQL.Text:='select CustomerID,pyCode,CustomerName,ProvinceID,CityID,Address,Zip,Phone,Fax,Email,HomePage,Industry,Type,Source,Status,Revenue,employees,owner,StockNo,Notes from customers';
ADOQuery1.Open;
DataSource1.DataSet:=adoquery1;

ADOtable1.Close;
ADOtable1.Connection:=ADOConnection1; //连接adotable后做的事情
ADOtable1.tablename:='customers';
ADOtable1.Open;

dbnavigator1.DataSource:=DataSource1;
dbgrid1.DataSource:=DataSource1;

edit1.Text:='';
f(); //外观设置的函数调用

procedure TForm3.ToolButton5Click(Sender: TObject); //刷新按钮
begin
adoquery1.Close;
adoquery1.Open;
f();
end;

我能写的都写了,但是刷新按钮还是错,错误提示如题。
我什么都不做,运行先按刷新还是出现同样的错误。
我不知道我sql语句哪里被修改了?
[解决办法]
Tedit(xcom).Text:=ADOquery1.Fields[i-2].Value; //break 按了之后这一条被选中了。错了么?
Tedit(xcom).Text:=ADOquery1.Fields[i-2].asstring;//用这个确保是文本
你的错误代码没有贴出来,你的F函数有问题。