Yang ini, copas dari scriptnya Pak Setiawan:
ll_filelength = filelength( ls_file)
li_filenum = fileopen(ls_file, streammode!)
if li_filenum = -1 then
rollback ;
messagebox( "Open Error","File open error occurred while tring to open " +
ls_file )
return
end if
if ll_filelength > 32765 then
if mod( ll_filelength , 32765 ) = 0 then
loops = ll_filelength / 32765
else
loops = ( ll_filelength / 32765 ) + 1
end if
else
loops = 1
end if
for inx = 1 to loops
fileread( li_filenum , b_read )
b_lib = b_lib + b_read
next
fileclose( li_filenum )
select count(*) into :li_c from prg where namafile = :ls_file ;
f_err("")
if li_c = 1 then
updateblob prg
set object = :b_lib
where namafile = :ls_file ;
f_err("")
else
// insert into prg ( namafile, versi, tgl )
insert into prg ( namafile ) values ( :ls_file ) ;
f_err("")
updateblob prg
set object = :b_lib
where namafile = :ls_file ;
f_err("")
end if
Silahkan dimodifikasi sesuai kebutuhan.
Salam,
Afri
-----Original Message-----
From: [email protected]
Sender: [email protected]
Date: Sun, 26 Jun 2011 22:32:48
To: [email protected]<[email protected]>
Reply-To: [email protected]
Subject: Re: [indopb] Add Blob di Datawindow
script yang mana ya mas afri... sorry newbie...
________________________________
From: Afrianto Dulbahri <[email protected]>
To: [email protected]
Sent: Monday, June 27, 2011 12:11 PM
Subject: Re: [indopb] Add Blob di Datawindow
Pakai script seperti yang dikirimkan Pak Setiawan Santosa Pak.
Salam,
Afri
________________________________
From: [email protected]
Sender: [email protected]
Date: Sun, 26 Jun 2011 22:04:47 -0700 (PDT)
To: [email protected]<[email protected]>
ReplyTo: [email protected]
Subject: [indopb] Add Blob di Datawindow
Saya mempunyai tabel Pegawai yg memiliki field foto(blob), gmn caranya agar
setiap row pegawai ada fotonya? karena file blob tidak dapat saya tambahkan
langsung dalam data window. trim ya