Dear friends,
this is my first comment in vbforums.
i am using a vb 6 application to save pdf files in oracle 11 g table. the file is to be saved in blob field. after saving the file in the table my application gets hanged.
'============================================
'Table name : P_files
'fields
' id varchar2(20)
' fdata blob
'File Path:d:\details.pdf
'============================================
Dim rsfile As ADODB.Recordset
Dim fileObj As ADODB.Stream
qry = " select * from P_Files where id 1=2"
Set rsfile = Nothing
Set rsfile = New ADODB.Recordset
rsfile .Open qry, gconfile, adOpenDynamic, adLockOptimistic 'gconfile is connection object to ora db
rsfile .AddNew
Set fileObj = New ADODB.Stream
If fileObj.State = 1 Then fileObj.Close
fileObj.Type = adTypeBinary
fileObj.Open
fileObj.LoadFromFile "d:\details.PDF"
rsfile .Fields("id").Value = "1"
rsfile .Fields("fdata").Value = fileObj.Read
rsfile .Update
rsfile .Close
fileObj.Close
Set rsfile = Nothing
Set fileObj = Nothing
kindly guide me whats making my application hang.
this is my first comment in vbforums.
i am using a vb 6 application to save pdf files in oracle 11 g table. the file is to be saved in blob field. after saving the file in the table my application gets hanged.
'============================================
'Table name : P_files
'fields
' id varchar2(20)
' fdata blob
'File Path:d:\details.pdf
'============================================
Dim rsfile As ADODB.Recordset
Dim fileObj As ADODB.Stream
qry = " select * from P_Files where id 1=2"
Set rsfile = Nothing
Set rsfile = New ADODB.Recordset
rsfile .Open qry, gconfile, adOpenDynamic, adLockOptimistic 'gconfile is connection object to ora db
rsfile .AddNew
Set fileObj = New ADODB.Stream
If fileObj.State = 1 Then fileObj.Close
fileObj.Type = adTypeBinary
fileObj.Open
fileObj.LoadFromFile "d:\details.PDF"
rsfile .Fields("id").Value = "1"
rsfile .Fields("fdata").Value = fileObj.Read
rsfile .Update
rsfile .Close
fileObj.Close
Set rsfile = Nothing
Set fileObj = Nothing
kindly guide me whats making my application hang.