图片存储问题,急,谢谢

aiq 2003-11-03 03:57:27
integer li_file
blob lb_pic

li_file=fileopen('1.jpg',StreamMode!,read!,lockread!)
fileread(li_file,lb_pic)

sqlca.AutoCommit=True
updateblob hb_gnlk set pic=:lb_pic where lkbm='3204008888200311030001' using sqlca;
If SQLCA.SQLDBCode <> 0 Then
messagebox("提示:","图片提交错误!")
RollBack;
End If
Commit;
sqlca.AutoCommit=False

fileclose(li_file)

数据库SQL 2000,字段image,图片不大,只有5K,但是图片保存不进去,SQLCA.SQLDBCode不等于0,提交失败,请大侠指教
...全文
25 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
langel 2003-11-04
  • 打赏
  • 举报
回复
同意楼上这位的观点,我想也是
aiq 2003-11-04
  • 打赏
  • 举报
回复
该问题我已经解决,谢谢各位帮助,但各位一个都没说对,也不是我操作问题
thelazyman 2003-11-04
  • 打赏
  • 举报
回复
注意字段pic为image类型,允许为null。
Awang_126 2003-11-04
  • 打赏
  • 举报
回复
PIC字段一允许为空
aiq 2003-11-04
  • 打赏
  • 举报
回复
integer li_file
blob lb_pic

li_file=fileopen('1.jpg',StreamMode!,read!,lockread!)
fileread(li_file,lb_pic)

sqlca.AutoCommit=True
updateblob aaa set pic=:lb_pic where code='3204008888200311030001' using sqlca;
If SQLCA.sqlnrows>1 Then messagebox("提示","图片提交成功!")
sqlca.AutoCommit=False

fileclose(li_file)
图片肯定有内容,但就是没保存成功,我表就两个字段code,pic,做实验用得
doublevip 2003-11-04
  • 打赏
  • 举报
回复
autocommit = true就不用commit;了,判断sqlnrows > 1 成功!
mittee 2003-11-03
  • 打赏
  • 举报
回复
数据库中是否
有某列的值不能为空
wantsong 2003-11-03
  • 打赏
  • 举报
回复
看上去没什么问题,你查查lb_pic的长度,是不是赋直为null?
aiq 2003-11-03
  • 打赏
  • 举报
回复
我用SQLCA.SQLErrText
它提示“在关键字‘NULL’附近有语法错误”
谢谢
workhand 2003-11-03
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/2416/2416503.xml?temp=.5173151

1,085

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧