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
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
Set rs = New ADODB.Recordset
sSql = "Select * from Media"
rs.Open sSql, Conn, adOpenKeyset, adLockPessimistic
strData = rs("MediaFamilyGuid").GetChunk(rs*("MediaFamilyGuid").ActualSize)
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
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center