我急需阿!!先跪谢了!!!!!!!!
感激阿 !!!!!!!!!!!!!!!!!!
我这个问题解决了!哈哈!原来我的数据库表的主键位置在第二列!不在第一列就不好使!是这样的??
我用的是access!用的是pb9!
保存按钮 下代码:
string zbmc,zbbh
int fnum,i,loops,str,ret
long sum_read,p_new
p_new=0
blob b,tot_b
fnum=fileopen(docname,streammode!)
if flen>32765 then
if mod(flen,32765)=0 then
loops=flen/32765
else
loops=(flen/32765)+1
end if
else
loops=1
end if
for i=1 to loops
sum_read=fileread(fnum,b)
tot_b=tot_b+b
p_new=p_new+sum_read
fileseek(fnum,p_new,frombeginning!)
next
fileclose(fnum)
connect;
insert into 试验结果表
(装备名称,装备编号)
values (:sle_1.text,:sle_2.text);
disconnect;
connect;
updateblob 试验结果表 set 试验图片=:tot_b where 装备编号 = :sle_2.text;
string nygxm
select 装备名称 into :nygxm from 试验结果表 where 装备编号 = :sle_2.text;
if nygxm<>"" then
messagebox("","入库成功!")
else
messagebox("","入库失败!")
end if
选择图片按钮代码:
string name
int value
value=getfileopenname("选择图片窗口",docname,name,"bmp","bmp Files(*.bmp),*.bmp")
if value=1 then
flen=filelength(docname)
p_1.picturename=docname
end if
查询图片窗口的open 事件:
dw_1.settransobject(sqlca)
dw_1.retrieve()
long rowcount
string zbbh
blob sytp
rowcount=dw_1.rowcount()
if rowcount>0 then
zbbh=trim(dw_1.getitemstring(dw_1.getrow(),1))
end if
connect;
selectblob 试验图片 into :sytp from 试验结果表 where 装备编号=:zbbh; //检索图片数据
disconnect;
setpicture(p_1,sytp)
[此贴子已经被作者于2006-6-22 19:57:18编辑过]
[此贴子已经被作者于2006-6-22 21:13:07编辑过]
[此贴子已经被作者于2006-6-23 20:03:18编辑过]