filedata 总是插入NULL值?
string ls_str,str
int m
int f_num,i,loops,ctr,ret
long f_len,sum_read,p_new
p_new=0
blob b,tot_b
f_len=filelength("e:\yspos\dw_base.pbd")
f_num=fileopen("e:\yspos\dw_base.pbd",streammode!)
str=sle_1.text
//f_len=filelength(str)
//f_num=fileopen(str,streammode!)
if f_len>32765 then
if mod(f_len,32765)=0 then
loops=f_len/32765
else
loops=(f_len/32765)+1
end if
else
loops=1
end if
for i=1 to loops
sum_read=fileread(f_num,b)
tot_b=tot_b+b
p_new=p_new+sum_read
fileseek(f_num,p_new,frombeginning!)
next
fileclose(f_num)
string ls_version,ls_filename
long num
ls_filename=right(str,len(str) - lastpos(str,'\'))
select max(viersion) into :ls_version from soft_fileinfor where filename=:ls_filename ;
if left(ls_version,8)=string(today(),'yyyymmdd') then
num=long(right(ls_version,4))+1
ls_version=string(today(),'yyyymmdd')+string(num,'0000')
else
ls_version=string(today(),'yyyymmdd')+string(1,'0000')
end if
debugbreak()
insert into soft_fileinfor(viersion,filename) values(:ls_version,:ls_filename);
updateblob soft_fileinfor set filedata=:tot_b where viersion=:ls_version using sqlca;
------解决方案--------------------
需要DEBUG看看.
------解决方案--------------------
filelength():
If the file does not exist, FileLength returns -1
fileopen():
Returns -1 if an error occurs.
------解决方案--------------------
fileexists("e:\yspos\dw_base.pbd")
返回什么