J
jin_liang_s
Unregistered / Unconfirmed
GUEST, unregistred user!
我的源码是
procedure TForm1.Button1Click(Sender: TObject);
var str_sql:string;
begin
str_sql:='select text1,text2,text3,text4 from huifangbiao';
query1.Close;
query1.SQL.Clear ;
query1.SQL.Add(str_sql);
query1.Prepare ;
query1.Open;
if query1.RecordCount >0 then
begin
dbgrid1.Columns.Items[0].FieldName:='text1';
dbgrid1.Columns.Items[1].FieldName:='text2';
dbgrid1.Columns.Items[2].FieldName:='text3';
dbgrid1.Columns.Items[3].FieldName:='text4';
end
end;
我在 sql explorer 中使用那句sql语句可查询出3条记录 ,但在dbgrid1中却没有一条记录的显示,这是为什么?如何解决?求各位高手帮忙
procedure TForm1.Button1Click(Sender: TObject);
var str_sql:string;
begin
str_sql:='select text1,text2,text3,text4 from huifangbiao';
query1.Close;
query1.SQL.Clear ;
query1.SQL.Add(str_sql);
query1.Prepare ;
query1.Open;
if query1.RecordCount >0 then
begin
dbgrid1.Columns.Items[0].FieldName:='text1';
dbgrid1.Columns.Items[1].FieldName:='text2';
dbgrid1.Columns.Items[2].FieldName:='text3';
dbgrid1.Columns.Items[3].FieldName:='text4';
end
end;
我在 sql explorer 中使用那句sql语句可查询出3条记录 ,但在dbgrid1中却没有一条记录的显示,这是为什么?如何解决?求各位高手帮忙