Q
qiluzhizi
Unregistered / Unconfirmed
GUEST, unregistred user!
sqldataset1.close;
sqldataset1.Close;
sqldataset1.CommandType:=cttable;
sqldataset1.CommandText:='DM_CZRY';
sqldataset1.Open;
sqldataset1.GetFieldNames(listbox1.Items);
//上面代码是正确的,出现数据
//下面代码出现field name missing的提示
sqldataset1.CommandType:= ctquery;
sqldataset1.CommandText:='SELECT * FROM DM_CZRY';
sqldataset1.open;
for i :=1 to sqldataset1.RecordCount do
begin
for j:=1 to sqldataset1.FieldCount do
begin
stringgrid1.Cells[j,i]:=sqldataset1.Fields[j-1].AsString;
sqldataset1.Next;
end ;
end;
stringgrid1.RowCount :=sqldataset1.RecordCount ;
在这段代码当中sqldataset1.FieldCount,这个没有错误,但是只要遇到
sqldataset1.RecordCount就出现错误。
sqldataset1.Close;
sqldataset1.CommandType:=cttable;
sqldataset1.CommandText:='DM_CZRY';
sqldataset1.Open;
sqldataset1.GetFieldNames(listbox1.Items);
//上面代码是正确的,出现数据
//下面代码出现field name missing的提示
sqldataset1.CommandType:= ctquery;
sqldataset1.CommandText:='SELECT * FROM DM_CZRY';
sqldataset1.open;
for i :=1 to sqldataset1.RecordCount do
begin
for j:=1 to sqldataset1.FieldCount do
begin
stringgrid1.Cells[j,i]:=sqldataset1.Fields[j-1].AsString;
sqldataset1.Next;
end ;
end;
stringgrid1.RowCount :=sqldataset1.RecordCount ;
在这段代码当中sqldataset1.FieldCount,这个没有错误,但是只要遇到
sqldataset1.RecordCount就出现错误。