안녕하세요!
이번에 파워빌더 버젼을 8.04에서 10.5로 버젼업할예정인데 일정기간 동시에 사용해야합니다.
파워빌더버젼(10.5)에서 생성된 PSR이미지파일이 구버젼8.04에서 오픈이 안되는데 오픈할수 있는 방법이 있으면 알려주세요!
8.04에서 생성된 psr이미지파일은 10.5에서 정상적으로 읽어오는데 10.5에서 생성된 psr이미지파일은 8.04에서 작업이 안됩니다.
source는 동일한 소스입니다.
//생성
Blob blb_tmp
STRING ls_userid, ls_pass, ls_username, ls_level, ls_approval[4]
INTEGER li_FileNum1, ll_num
LONG n_bytes, ll_pos,ll_ret
datetime lda_date
integer loops, i
long flen, bytes_read, new_pos
blob b, tot_b
string sle_filename
sle_filename = gs_down_path + string(ll_c_unique) + ".psr"
ll_ret= dw_3.saveas(sle_filename,psreport!,false)
// Get the file length, and open the file
flen = FileLength(sle_filename)
li_FileNum1 = FileOpen(sle_filename,StreamMode!, Read!, LockRead!)
// Determine how many times to call FileRead
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
// Read the file
new_pos = 1
FOR i = 1 to loops
bytes_read = FileRead(li_FileNum1, b)
tot_b = tot_b + b
NEXT
FileClose(li_FileNum1)
//결재이미지 변경!
UPDATEBLOB c_acc_master_psr
SET c_psrdata = :tot_b
where c_unique = :ll_c_unique;
filedelete(sle_filename)
commit;
/////////////////////////////////////
//불러오기integer li_FileNum, loops, i
long flen, bytes_read, new_pos
string ls_filename
// Get the file length, and open the file
flen = len(lb_psrdata)
ls_filename = gs_down_path + string(gd_unique) + ".psr"
li_FileNum = FileOpen(ls_filename,StreamMode!, Write!, Shared!, Replace!)
// Determine how many times to call FileRead
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
// Read the file
new_pos = 1
FOR i = 1 to loops
bytes_read = Filewrite(li_FileNum, blobmid(lb_psrdata,new_pos,32765))
new_pos = new_pos + bytes_read
NEXT
FileClose(li_FileNum)
of_change_dw(ls_filename)
this.of_display_sign()
첫댓글 이제야 답변을 합니다.
읽지 못한다는 질문이 애매모하여 생각을 많이 했습니다.
이제야 질문을 이해 했습니다. FileOpen 할때 LockRead 말고 shared 로 해보세요