请帮忙看一下以下代码为何出错....
yzqb 2002-03-09 03:35:33 /*以下的代码写在rowsfocuschanged 事件中,目的是要将图象从SQl Server 数据库中读出显示在DW_1的P_1中可是Retrieve()能读出并显示,当移动到下一行就报内存错误,Pb7.03,请帮忙解决或提供更好的方法*/
String ryid,f,t
blob b
integer li_f
Boolean flag=True
//FileDelete("c:\temp\pic.jpg")
dw_1.object.P_1.filename = ""
ryid=dw_1.getitemstring(dw_1.getrow(),"ryid")
SELECTBLOB pic INTO :b
FROM t_dwry WHERE ryid = :ryid;
if len(b) > 0 then
li_f = FileOpen(ryid+ ".jpg",StreamMode!,Write!,LockWrite!,Replace!)
FileWrite(li_f,b)
FileClose(li_f)
f=ryid+ ".jpg"
t="c:\temp\pic.jpg"
if CopyFileA(f,t,flag) then// CopyFileA 为声明的API函数
dw_1.object.P_1.filename = "c:\temp\pic.jpg"
end if
end if