Trying to read binary data from a Access database file.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Trying to read binary data from a Access database file.

  1. #1
    David McCollough Guest

    Trying to read binary data from a Access database file.


    I am trying to read a binary field from an access database using ADO.

    I have tried several different examples and all seem to yield the same error
    message.

    When the line executes that supposed to retrive the data I get the error:

    Run-Time Error: 3219

    Operation is not allowed in this context.

    Can somebody tell me what I'm doing wrong.

    Here is the code:

    Dim Conn As ADODB.Connection
    Dim rs As ADODB.Recordset

    Dim strData As String

    Set Conn = New ADODB.Connection

    Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\DB\mydb.mdb;Persist
    Security Info=False"

    Conn.Open

    Set rs = New ADODB.Recordset

    sSql = "Select * from Media"

    rs.Open sSql, Conn, adOpenKeyset, adLockPessimistic

    strData = rs("MediaFamilyGuid").GetChunk(rs*("MediaFamilyGuid").ActualSize)





  2. #2
    Phil Weber Guest

    Re: Trying to read binary data from a Access database file.


    > Run-Time Error: 3219
    > Operation is not allowed in this context.
    > Can somebody tell me what I'm doing wrong?


    David: What field type is MediaFamilyGuid? This error usually means that
    you're trying to use GetChunk to read data from a field that doesn't support
    it.
    ---
    Phil Weber


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center