我在TStringGrid1.rowcount:=25赋值时出现访问冲突的问题,很奇怪,当我将TStringGrid1.rowcount赋值小于14
时没问题,但当大于14时就出现访问冲突的问题,我看了下 TSringGrid 的属性中好像没设置行数限制的属性啊。。
请高手指教指教,谢谢
时没问题,但当大于14时就出现访问冲突的问题,我看了下 TSringGrid 的属性中好像没设置行数限制的属性啊。。
请高手指教指教,谢谢
var sqlstr:string;
i:integer;
currhostid:string;
begin
combobox1.Items.Clear;
sqlstr:='..........';//省略
form_struectree.querymessage(dbfrm.Query1,sqlstr);
if dbfrm.Query1.RecordCount<1 then exit;
dbfrm.Query1.First;
i:=0;
listbox1.Items.Clear;
while not dbfrm.Query1.Eof do
begin
combobox1.Items.Add(dbfrm.Query1.fieldbyname('type_name').AsString);
stationtype[i]:=dbfrm.Query1.fieldbyname('station').AsInteger;
listbox1.Items.Add(inttostr(dbfrm.query1.fieldbyname('station').asinteger));
dbfrm.Query1.Next;
i:=i+1;
end;
sqlstr:='select host_name,hostid,status from sfis1.c_host_name_t where
form_struectree.querymessage(dbfrm.Query1,sqlstr);
if dbfrm.Query1.RecordCount<1 then exit
currhost:=inttostr(dbfrm.Query1.fieldbyname('host').AsInteger); sqlstr:='。';
form_struectree.querymessage(dbfrm.Query1,sqlstr);//执行SQL语句
stringgrid1.RowCount:=dbfrm.Query1.RecordCount+1;//就是这里,当dbfrm.Query1.RecordCount
数量不大时不会报错,一超过14就开始报错,这是一个窗体打开的代码,而且没有ONCREAT(),请指教