大虾们:
我用以下语句取出数据:rst.CursorType:=2;
rst.LockType:=3;
rst.open('select * from 某表',cnn,,,1);要传给StringGrid:stringgrid1.Cells[c,r]:=rst.Fields[c];当rst.Fields[c]为空值是出错了!试过无数方法,不得解。请高手指点!
我用以下语句取出数据:rst.CursorType:=2;
rst.LockType:=3;
rst.open('select * from 某表',cnn,,,1);要传给StringGrid:stringgrid1.Cells[c,r]:=rst.Fields[c];当rst.Fields[c]为空值是出错了!试过无数方法,不得解。请高手指点!
stringgrid1.Cells[c,r]:=''
不好意思,现在才上网。rst.Fields[c].asstring也不行。不存在asstring方法。
顺便问问大家,在form中显示数据表,用什么控件最多?
stringgrid1.Cells[c,r]:=rst.fieldbyname('c').asstring;