Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to save MS Word into MS SQL Server in PB6? 1

Status
Not open for further replies.

kmsam2

Programmer
May 21, 2003
29
MY
I need to save Ms word document into ms sql server table.
Should be BLOB right?
any sample code in PB to do this?


Sam.
 
blob b,b_temp
long ll_file_len
integer li_file_num
string ls_filename = "c:\document1.doc"

ll_file_len = filelength(ls_filename)
li_file_num = FileOpen(ls_filename, StreamMode!, Read!, LockReadWrite!)

do while FileRead(li_file_num, b_temp) > 0
b += b_temp
loop

FileClose(li_file_num)

UPDATEBLOB Employee SET word_doc = :b
WHERE Emp_num = 100
USING Emp_tran ;
 
thanks a lot!
how to read from blob and convert back to Ms Word?

Sam.
 
I have good luck today!
I was looking for this!

[bomb] Lenin.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top