执行 query_cbtyt.ApplyUpdates();出错?
解决方案 »
- 对一堆连续的数字怎样生成非连续、不规则且唯一的数字??
- 如何在Delphi里面获取当前屏幕的分辨率?请给示例代码,谢谢!
- 请问在一个窗体中怎么动态生成一个控件(在另外一个窗体上)
- 组件随窗体的变化而随之变化,并且位置不变??
- 数据库连接
- 请问如何用SQL语句知道数据库中的表是否存在。
- 打印问题
- 关于query定位某行后,显示在DBgrid某个位置上的问题(急急急)
- 动态创建菜单的高手进来瞧瞧吧!
- 仇深似海,为什么女人会这样!!!!!!!!!!!!!!!!!!
- Image1.Canvas.FillRect(Rect(0,0,Image1.Width,Image1.Height))如果窗体先不全屏,后全凭,并不能填充整个画布,这是为什么呢?
- 继承ADODataSet 如何对字段列表中的字段添加属性(有点难).
begin
if (dh0='') or(syzdz0='') then
begin
messagebox(handle,'参数传递有错误,请与系统管理员联系','严重错误',mb_iconerror);
exit;
end;
try
if not sub_table.Active then sub_table.Active:=true;
GroupBox1.Enabled:=true;
sub_table.Append;
sub_table.FieldByName('dh').AsString:=dh0;
sub_table.FieldByName('syzdz').AsString:=syzdz0;
sub_table.FieldByName('srry').AsString:=user_info.yhmc;
sub_table.FieldByName('srrq').AsString:=formatdatetime('yyyy-mm-dd',now);
sub_table.FieldByName('xgry').AsString:=user_info.yhmc;
sub_table.FieldByName('xgrq').AsString:=formatdatetime('yyyy-mm-dd',now);
//opendialog1.Filter:='All (*.'+wjhz0+')|*.'+wjhz0;
// opendialog1.Filter:='All (*.jpg;*.jpeg;*.bmp;*.ico;*.emf;*.wmf)|*.jpg;*.jpeg;*.bmp;*.ico;*.emf;*.wmf';
if opendialog1.Execute then
begin
if (getfilesize(opendialog1.FileName)/(1024*1024))>8.0 then
begin
messagebox(handle,pchar('文件大小不能超过8M,请选择其它的文件!'),'错误信息-文件太大',mb_iconerror);
sub_table.Cancel;
GroupBox1.Enabled:=false;
exit;
end;
sub_Table.Edit;
(sub_Table.FieldByName('nr') as tblobfield).LoadFromFile(opendialog1.FileName);
wjhz0:=uppercase(ExtractFileExt(opendialog1.FileName));
delete(wjhz0,1,1);
sub_table.FieldByName('wjhzmc').AsString:=wjhz0;
try
sub_table.Connection.BeginTrans;
// sub_table.Database.StartTransaction;
sub_table.Post;
finally
// sub_table.Database.Commit;
sub_table.Connection.CommitTrans;
end;
sub_table.close;
sub_table.Open;
if image1.Visible then showimage;
btn_add.Enabled:=false;
if sub_table.RecordCount >0 then
begin
OleContainer1.CreateObjectFromFile(opendialog1.FileName,false);
OleContainer1.run;
OleContainer1.Visible:=true;
end;
end
else
begin
sub_table.Cancel;
GroupBox1.Enabled:=false;
end;
except
sub_table.Cancel;
GroupBox1.Enabled:=false;
end;
end;
你试试
query_cbtyt.ApplyUpdates(1);