hello everybody
i am trying to insert an image into oracle database but i am getting an unspecified error.here is my code fot the samei am getting the unspecified error(-2147467259) on the Select statement.I have oracle 9i as my database and thre is one BLOB field called IMG in the table.I am using ADO 2.6 library.VB Code:
'Public Function SaveImage() ' 'Dim PictBmp As String 'Dim ByteData() As Byte 'Dim SourceFile As Integer ' 'PictBmp = "C:\z123456.jpg" ' 'With cn ' .Provider = "MSDASQL.1" ' .cnectionString = "Password=test;Persist Security Info=True;User ID=test;Data Source=test123" ' .Open 'End With ' ' ' ''With rs '' .Activecnection = cn '' .CursorType = adOpenKeyset '' .LockType = adLockOptimistic '' .Source = "SELECT IMG FROM CAMERA_IMG WHERE SRNO = 1" '' .Open ''End With ' 'SourceFile = FreeFile 'Open PictBmp For Binary Access Read As SourceFile 'FileLength = LOF(SourceFile) 'Dim FileMgr As New FileManager ' 'If FileLength = 0 Then ' Close SourceFile ' 'Else ' Numblocks = FileLength / BlockSize ' LeftOver = FileLength Mod BlockSize ' ' ReDim ByteData(LeftOver) ' Get SourceFile, , ByteData() ' rs(1).AppendChunk ByteData() ' ' ReDim ByteData(BlockSize) ' For i = 1 To Numblocks ' Get SourceFile, , ByteData() ' rs(1).AppendChunk ByteData() ' Next i ' ' rs.Update 'Commit the new data. ' ' Close SourceFile 'End If ' ' 'End Function
parth




Reply With Quote