往数据表里面成功插入数据后 出现异常对话框
Access violation at address 055A0E94 in module 'project1.ext',Reader of address 00000024
请问怎么才能不出现这个咚咚以下时插入程序
procedure TMainForm.Button14Click(Sender: TObject);
var
i : integer;
begin
if ComboBox5.Items.Strings[ComboBox5.ItemIndex] <> '' then
begin
if Edit13.Text <> '' then
begin
if Edit14.Text <> '' then
begin
if Edit16.Text <> '' then
begin
try
with rqADOQuery do
begin
for i:=0 to listview4.Items.Count do
begin
sql.Clear;
sql.Add('insert into Extra(栋号,房号,姓名,类型,面积,单价,应收日期,月应收费用,实收日期,日收滞纳金比例) values(:栋号,:房号,:姓名,:类型,:面积,:单价,:应收日期,:月应收费用,:实收日期,:日收滞纳金比例)');
parameters.ParamByName('栋号').Value := listview4.Items[i].Caption;
parameters.ParamByName('房号').Value := listview4.Items[i].SubItems.Strings[0];
parameters.ParamByName('姓名').Value := listview4.Items[i].SubItems.Strings[1];
parameters.ParamByName('类型').Value := listview4.Items[i].SubItems.Strings[2];
parameters.ParamByName('面积').Value := listview4.Items[i].SubItems.Strings[3];
parameters.ParamByName('单价').Value := listview4.Items[i].SubItems.Strings[4];
parameters.ParamByName('应收日期').Value := Edit13.Text;
parameters.ParamByName('月应收费用').Value := listview4.Items[i].SubItems.Strings[5];
parameters.ParamByName('实收日期').Value := Edit14.Text;
parameters.ParamByName('日收滞纳金比例').Value := Edit16.Text;
execsql;
end;
end;
except
Messagedlg('插入信息不成功',mtError,[mbok],0);
end;
end
else showmessage('请输入滞纳金比例!');
end
else showmessage('请输入日期信息!');
end
else showmessage('请输入日期信息!');
end
else showmessage('请输入栋号!');
end;
Access violation at address 055A0E94 in module 'project1.ext',Reader of address 00000024
请问怎么才能不出现这个咚咚以下时插入程序
procedure TMainForm.Button14Click(Sender: TObject);
var
i : integer;
begin
if ComboBox5.Items.Strings[ComboBox5.ItemIndex] <> '' then
begin
if Edit13.Text <> '' then
begin
if Edit14.Text <> '' then
begin
if Edit16.Text <> '' then
begin
try
with rqADOQuery do
begin
for i:=0 to listview4.Items.Count do
begin
sql.Clear;
sql.Add('insert into Extra(栋号,房号,姓名,类型,面积,单价,应收日期,月应收费用,实收日期,日收滞纳金比例) values(:栋号,:房号,:姓名,:类型,:面积,:单价,:应收日期,:月应收费用,:实收日期,:日收滞纳金比例)');
parameters.ParamByName('栋号').Value := listview4.Items[i].Caption;
parameters.ParamByName('房号').Value := listview4.Items[i].SubItems.Strings[0];
parameters.ParamByName('姓名').Value := listview4.Items[i].SubItems.Strings[1];
parameters.ParamByName('类型').Value := listview4.Items[i].SubItems.Strings[2];
parameters.ParamByName('面积').Value := listview4.Items[i].SubItems.Strings[3];
parameters.ParamByName('单价').Value := listview4.Items[i].SubItems.Strings[4];
parameters.ParamByName('应收日期').Value := Edit13.Text;
parameters.ParamByName('月应收费用').Value := listview4.Items[i].SubItems.Strings[5];
parameters.ParamByName('实收日期').Value := Edit14.Text;
parameters.ParamByName('日收滞纳金比例').Value := Edit16.Text;
execsql;
end;
end;
except
Messagedlg('插入信息不成功',mtError,[mbok],0);
end;
end
else showmessage('请输入滞纳金比例!');
end
else showmessage('请输入日期信息!');
end
else showmessage('请输入日期信息!');
end
else showmessage('请输入栋号!');
end;
解决方案 »
- 关于方便粉丝的通告!谁下的毒?
- 关于adoquery的filter使用的问题?
- 请问如何使 OpenDialog 只返回 文件名 !!!!!!!!!! 急呀!!
- dbgrid控件如何能在左边显示行号?
- 我初学,不知什么原因sendmessage失败,急死我了,请各位高手指点
- WaitForSingleObject()的几个返回值到底是什么 意思?混淆不清!
- 转化问题,高手帮忙~!
- http://www.hyperjoint.com/downdolink.htm这个软件是怎么做的?
- 怎么看手机三包?
- 关于ODBC客户机端配置的问题
- delphi的类变量和VB的有何不同?
- access数据库图片存取问题(初级)
是for i:=0 to listview4.Items.Count-1 do因为是从0开始的,所以到减一结束
大部分都是,呵呵