图片不能显示反而出现“执行非法操作,即将关闭!”,帮我看看这是怎么回事呀!
有一张表: Table1
Student: ID(autoID),name(text),sex(text), pic(为OLE对象类型)
我在窗体中加了 一个数据窗口控件dw_1(显示ID。。。Sex)
和一个Picture控件p_1(显示pic字段中的图片)
当我点击数据窗口中任意一条记录时,想在Picture控件中显示相关图片
代码如下:(在dw_1的rowfocuschanged事件中)
Blob lbb_pic //用来保存图片
String ls_id //保存ID值
If CurrentRow<=0 Then Return //选中当前行
This.SelectRow(0,False)
This.SelectRow(CurrentRow,True)
SetPointer(HourGlass!)
ls_id= Trim(This.GetItemString(CurrentRow,"id"))
If Len(ls_id)>0 Then
selectblob pic into:lbb_pic from student where id=:ls_id; //读取图片
If Len(lbb_pic)>0 Then //判断是否选出了数据
p_1.SetPicture(lbb_pic) //显示图片
Else
Beep(2)
MessageBox("提示",ls_id + "没有照片",Information!)
End if
End if
SetPointer(Arrow!)
运行后出错!
图片不能显示反而出现“执行非法操作,即将关闭!”,帮我看看这是怎么回事呀!