Results 1 to 7 of 7

Thread: Error When Selecting Data from Blob

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2005
    Posts
    71

    Error When Selecting Data from Blob

    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 same
    VB Code:
    1. 'Public Function SaveImage()
    2. '
    3. 'Dim PictBmp As String
    4. 'Dim ByteData() As Byte
    5. 'Dim SourceFile As Integer
    6. '
    7. 'PictBmp = "C:\z123456.jpg"
    8. '
    9. 'With cn
    10. '    .Provider = "MSDASQL.1"
    11. '    .cnectionString = "Password=test;Persist Security Info=True;User ID=test;Data Source=test123"
    12. '    .Open
    13. 'End With
    14. '
    15. '
    16. '
    17. ''With rs
    18. ''    .Activecnection = cn
    19. ''    .CursorType = adOpenKeyset
    20. ''    .LockType = adLockOptimistic
    21. ''    .Source = "SELECT IMG FROM CAMERA_IMG WHERE SRNO = 1"
    22. ''    .Open
    23. ''End With
    24. '
    25. 'SourceFile = FreeFile
    26. 'Open PictBmp For Binary Access Read As SourceFile
    27. 'FileLength = LOF(SourceFile)
    28. 'Dim FileMgr As New FileManager
    29. '
    30. 'If FileLength = 0 Then
    31. '    Close SourceFile
    32. '
    33. 'Else
    34. '    Numblocks = FileLength / BlockSize
    35. '    LeftOver = FileLength Mod BlockSize
    36. '
    37. '    ReDim ByteData(LeftOver)
    38. '     Get SourceFile, , ByteData()
    39. '     rs(1).AppendChunk ByteData()
    40. '
    41. '     ReDim ByteData(BlockSize)
    42. '     For i = 1 To Numblocks
    43. '         Get SourceFile, , ByteData()
    44. '         rs(1).AppendChunk ByteData()
    45. '     Next i
    46. '
    47. '     rs.Update   'Commit the new data.
    48. '
    49. '    Close SourceFile
    50. 'End If
    51. '
    52. '
    53. 'End Function
    i 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.

    parth
    Last edited by Hack; Mar 16th, 2006 at 08:14 AM. Reason: Added [vbcode] [/vbcode] tags for more clarity.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width