UPDATE更新TEXT字段,不成功

xilaianzxsc 2016-07-08 04:48:35



以下命令中的 fahuo_pic字段,是TEXT类型,用来储存用户的图片的.


一、在SQL 2000下执行此命令
update fahuohead set fahuo_pic = null from fahuohead where id = 4
此命令正常运行,字段能被更新为NULL (不受该字段占用字节大小的限制)

二、在VFP9 + SQL2000下 :

如果图片较小,上述命令也能正常执行
如果图片很大,如100K,则上述命令,无法将该字段更新为NULL。

问:在VFP9下,如果遇到相对较大一点的图片,如何使上述命令,能得到正常运行?
...全文
413 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
都市夜猫 2016-07-09
  • 打赏
  • 举报
回复
不懂,既然是要更新为 null,跟图片大小就应该没关系 试试: cc = getpict() if empty(cc) retu .f. endif cc = strconv(cc, 13) if sqlexec(连接句柄, 'update fahuohead set fahuo_pic = ?cc from fahuohead where id = 4') > 0 sqlcommit(连接句柄) if sqlexec(连接句柄, 'select fahuo_pic from fahuohead where id = 4', 'ttt') > 0 messagebox('图片已上传并下载成功, 数据长度:' + transform(len(strconv(fahuo_pic,14)))) endif endif messagebox('点确定,清空 id = 4 的图片命令') cc = null if sqlexec(连接句柄, 'update fahuohead set fahuo_pic = ?cc from fahuohead where id = 4') > 0 sqlcommit(连接句柄) if sqlexec(连接句柄, 'select fahuo_pic from fahuohead where id = 4', 'ttt') > 0 messagebox('图片已清空, 数据长度:' + transform(iif(isnull(fahuo_pic),0,len(strconv(fahuo_pic,14))))) endif endif

2,722

社区成员

发帖
与我相关
我的任务
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
  • VFP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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