如何在PB中查找SQL Server中的图片

allon7 2012-12-15 08:55:10
有一个项目需要在数据库中建立图片库,然后在PB中根据对于图片ID来调用相应的图片
本人新手,不知道如何实现,求达人指导~
...全文
217 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
allon7 2012-12-17
  • 打赏
  • 举报
回复
谢谢LS 代码值得参考 读取的也请不吝赐教啊~
引用 2 楼 xexev112 的回复:
给你点 代码 做下参考 设置BLOB变量 进行存储读取过程 string ls_pathname, ls_filename integer li_value,li_FileNum,loops,i long ll_fileLength,bytes_read,new_pos blob b, tot_b Blob gb_photo //name= string(sl……
ych12333 2012-12-17
  • 打赏
  • 举报
回复
二楼说的对,存路径就可以了。否则以后图片多的话数据库受不了。
xexev112 2012-12-16
  • 打赏
  • 举报
回复
给你点 代码 做下参考 设置BLOB变量 进行存储读取过程 string ls_pathname, ls_filename integer li_value,li_FileNum,loops,i long ll_fileLength,bytes_read,new_pos blob b, tot_b Blob gb_photo //name= string(sle_1.text) 数据窗口查询变量 li_value = GetFileOpenName("选择照片", & + ls_pathname, ls_filename, "jpg","Jpg Files (*.jpg),*.jpg") IF li_value = 1 THEN SetPointer(HourGlass!) ll_fileLength= FileLength(ls_filename) li_FileNum = FileOpen(ls_filename, & StreamMode!, Read!, LockRead!) IF ll_filelength > 32765 THEN IF Mod(ll_filelength, 32765) = 0 THEN loops =ll_filelength/32765 ELSE loops = (ll_filelength/32765) + 1 END IF ELSE loops = 1 END IF new_pos = 1 FOR i = 1 to loops bytes_read = FileRead(li_FileNum, b) tot_b = tot_b + b NEXT FileClose(li_FileNum) gb_photo=tot_b UPDATEBLOB employee_basic SET pc = :gb_photo where emp_name = :name USing sqlca; IF Sqlca.SQLNRows > 0 THEN messagebox("提示","数据保存成功") COMMIT USING SQLCA; END IF P_1.setpicture(gb_photo) Elseif li_value=-1 then MessageBox("选择照片","打开文件错误!") End If 如果 使用 可以 我再把 读取图片的代码 给你
xuam 2012-12-16
  • 打赏
  • 举报
回复
存路径就行了吧

1,076

社区成员

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

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