代码如下:
procedure TForm8.ComboBox1Change(Sender: TObject);
var
i:integer;
begin
form1.adoquery1.Recordset.MoveFirst;
i := ComboBox1.ItemIndex;
form1.adoquery1.recordset.Move(i,0);
edit1.Text := form1.adoquery1.Recordset.Fields.Item[1].Value;
edit2.Text := form1.adoquery1.Recordset.Fields.Item[2].Value;
edit3.Text := form1.adoquery1.Recordset.Fields.Item[3].Value;
end;end.
当执行该事件后提示:could not convert variant fo type (Null)into type (string)随便那一个字段里面的内容有是空就会报这个错.请高手指教一下该怎么改!谢谢了!!
procedure TForm8.ComboBox1Change(Sender: TObject);
var
i:integer;
begin
form1.adoquery1.Recordset.MoveFirst;
i := ComboBox1.ItemIndex;
form1.adoquery1.recordset.Move(i,0);
edit1.Text := form1.adoquery1.Recordset.Fields.Item[1].Value;
edit2.Text := form1.adoquery1.Recordset.Fields.Item[2].Value;
edit3.Text := form1.adoquery1.Recordset.Fields.Item[3].Value;
end;end.
当执行该事件后提示:could not convert variant fo type (Null)into type (string)随便那一个字段里面的内容有是空就会报这个错.请高手指教一下该怎么改!谢谢了!!
解决方案 »
- 大家看看现在的RIA开发,赶上了C/S的功能了把 (我最近做的一个程序)
- 为什么32BIT的BMP的颜色容PATTATE总为0????特急!!!!
- 谁来帮我看看啊?
- 长期潜水.....为了表示厚道..散分...
- 原来今天是我生日啊, 我都给忘了, 刚刚中国联通发来短信我才知道, 汗! 散分100
- 请教高手:如何不让我的程序不被重复运行呢?
- 用Dll来更新主界面的菜单如何实现,在线等...具体描述见下。解决马上给分.........
- 有没有了解创智情况的朋友?想去创智,了解一下情况先!
- 江湖告急!!!!!!!!
- 请问delphi里如何创建一个文件目录?
- StringGrid 动态创建按钮
- DCOM发布的问题
edit2.Text := form1.adoquery1.Recordset.Fields.Item[2].asstring;
edit3.Text := form1.adoquery1.Recordset.Fields.Item[3].asstring;
edit2.Text := form1.adoquery1.Fields[2].asstring;
edit3.Text := form1.adoquery1.Fields[3].asstring;
edit2.text 里面出现了edit3.text的值.
edit3.text 里面出现了我数据库里面的最后一个字段里面的值,(最后一个字段是不需要显示的)完了在运行combobox,就没动静了!!