ls_pathname= docname
ll_length=filelength(ls_pathname) //检查图片是否大于32765,因为fileread一次只能读32765
if ll_length>0 then //文件存在
if ll_length<32765 then //如果小于32765,就可以马上读出来
li_fh = FileOpen(ls_pathname, StreamMode!, read!, Shared!, Replace!)
if li_fh <> -1 and not isnull(li_fh) then
FileRead(li_fh, blob_reader_pic)
FileClose(li_fh)
end if
else //当文件大于32765时
ll_size=ll_length/32765+1 //计算出fileread要花几次读出
li_fh = FileOpen(ls_pathname, StreamMode!, read!, Shared!, Replace!)
if li_fh <> -1 then
for ll_i=1 to ll_size
FileRead(li_fh, blob_temp) //每次读出32765字节
blob_reader_pic=blob_reader_pic+blob_temp //将读出的内容累加到另一个二进制文件中
next
FileClose(li_fh)
else
messagebox('提示','错误')
return
end if
end if
ls_iccard_id=dw_2.object.vc_iccard_id[ll_row]
Updateblob readers
Set blob_pic =:blob_reader_pic
Where vc_iccard_id =:ls_iccard_id;
if sqlca.sqlcode = 0 then
commit;
else
MessageBox("提示","更新文件出错")
Rollback;
END IF
blob_reader_pic = blob("")
else
MessageBox("提示","文件<"+ls_pathname+">不存在!")
end if
ll_rowcount = dw_2.rowcount()
for ll_row=1 to ll_rowcount
sle_1.text=string(ll_row)+"/"+string(ll_rowcount)
ls_no=trim(dw_2.object.vc_reader_no[ll_row])
ls_pathname= ls_path +ls_no+ ".jpg"
ll_length=filelength(ls_pathname) //检查图片是否大于32765,因为fileread一次只能读32765
if ll_length>0 then //文件存在
if ll_length<32765 then //如果小于32765,就可以马上读出来
li_fh = FileOpen(ls_pathname, StreamMode!, read!, Shared!, Replace!)
if li_fh <> -1 and not isnull(li_fh) then
FileRead(li_fh, blob_reader_pic)
FileClose(li_fh)
end if
else //当文件大于32765时
ll_size=ll_length/32765+1 //计算出fileread要花几次读出
li_fh = FileOpen(ls_pathname, StreamMode!, read!, Shared!, Replace!)
if li_fh <> -1 then
for ll_i=1 to ll_size
FileRead(li_fh, blob_temp) //每次读出32765字节
blob_reader_pic=blob_reader_pic+blob_temp //将读出的内容累加到另一个二进制文件中
next
FileClose(li_fh)
else
messagebox('提示','错误')
return
end if
end if
ls_iccard_id=dw_2.object.vc_iccard_id[ll_row]
Updateblob readers
Set blb_photo=:blob_reader_pic
Where vc_iccard_id =:ls_iccard_id;
if sqlca.sqlcode = 0 then
commit;
else
MessageBox("提示","更新照片出错")
Rollback;
END IF
blob_reader_pic = blob("")
else
MessageBox("提示","文件<"+ls_pathname+">不存在!")
end if
next