blob lb_image
blob lb_small
Blob gb_photo,lb_file
integer li_file,li_ret,loops,i,Net,v_count
string ls_file,ls_path,ls_xtrq
long flen,bytes_read,new_pos,v_bh,ll_len
ls_xtrq=string(g_xtrq)
setnull(lb_image)
select seq_t_xzwj_id.nextval into :v_bh from dual;
//search the file
li_ret = getfileopenname("选择文件",ls_path,ls_file, "*","文件(*.*),*.*")
sle_1.text=ls_path
if li_ret = 1 then
Net=MessageBox("提示信息","是否存储文件?",Exclamation!,OKCancel!)
IF Net = 1 THEN
if li_file <> -1 then
flen = filelength(ls_file)
li_file = fileopen(ls_path,streammode!,read!,lockread!)
if flen > 32765 then
if mod(flen,32765)=0 then
loops = flen/32765
else
loops = (flen/32765) + 1
end if
else
loops = 1
end if
new_pos = 1
for i = 1 to loops
bytes_read = fileread(li_file,lb_small)
if i = 1 then
lb_image = lb_small
else
lb_image = lb_image + lb_small
end if
next
fileclose(li_file)
gb_photo=lb_image
end if
end if
end if
insert into t_xzwj(id,fliemc,adddate,mancode,manname,fcbz) values(:v_bh,:ls_file,:ls_xtrq,:g_gzrbm,:g_gzrmc,'否');
if sqlca.sqlcode <> 0 then
rollback;
messagebox('提示信息','提交失败!'+string(sqlca.sqlcode)+sqlca.sqlerrtext)
return
else
messagebox('v_bh',v_bh)
select count(*) into :v_count from t_xzwj WHERE id =:v_bh USING sqlca;
messagebox('v_count',v_count)
updateblob t_xzwj set file =:gb_photo WHERE id =:v_bh USING sqlca;
P_1.setpicture(gb_photo)
if sqlca.sqlcode <> 0 then
ROLLBACK;
messagebox('提示信息1','提交失败!'+string(sqlca.sqlcode)+sqlca.sqlerrtext)
return
else
commit;
messagebox('提示信息','文件存储成功!')
end if
end if
图片显示都没有问题,但是updateblob的时候就失败,没找到原因。
------解决方案--------------------
错误提示是什么?
------解决方案--------------------
Boolean lb_AutoCommit
lb_AutoCommit = SQLCA.AutoCommit
SQLCA.AutoCommit = TRUE
updateblob t_xzwj set file =:gb_photo WHERE id =:v_bh USING sqlca;
SQLCA.AutoCommit = lb_AutoCommit
------解决方案--------------------
先按以下这么写,看一下错误
updateblob t_xzwj set file =:gb_photo WHERE id =:v_bh USING sqlca;
if sqlca.sqlcode <> 0 then
messagebox('提示信息1','提交失败!'+string(sqlca.sqlcode)+sqlca.sqlerrtext)
return
else
commit;
messagebox('提示信息','文件存储成功!')
end if
------解决方案--------------------
你用了oracle的关键字