DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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


Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links