GetChunk/Memo problem

Hi,

I'm having trouble extracting data from an Access Memo field using a Microsoft Remote Data Control. I'm using VB6. All the examples show something like:

Dim Buffer() As Byte
Buffer() = Rs!Myfield.GetChunk(dataSize)

For me this raises the error 'invalid use of null' since this is what Rs!Myfield.GetChunk(dataSize) is always returning.

Testing using a short memo both Rs!Myfield.ColumnSize and Rs!Myfield.Value are correct in the watch window - Rs!Myfield.ChuckRequired = true. (Aside: assigning Rs!Myfield.Value directly to a string raises the error 07001 'incorrect number of parameters')

What am I doing wrong?

Cheers
cegg1Asked:
Who is Participating?
 
ventondConnect With a Mentor Commented:
Here is what I use. My code uses a DAO control, but it should be the same
           
Dim String1 As String
String1 = Data1.Recordset("FileImage").GetChunk(Offset, 64000)
0
 
cegg1Author Commented:
[This same question is posted to the Computers section in error - so 50 more points there for the answer]
0
 
TimCotteeCommented:
Dim cnkChunk() As Byte
Dim lngChunkLength As Long

Private Sub Command1_Click()
    lngChunkLength = 100
    cnkChunk = MSRDC1.Resultset!Memo.GetChunk(lngChunkLength)
    Text1.Text = cnkChunk
End Sub

I have used the above code to do this task and it seems to work ok, with a remote data control,textbox and command button on the form.
0
 
cegg1Author Commented:
Thanks for the reply Tim. Unfortunately this doesn't work for me. Any ideas why? (It's sticking on this GetChunk() returning null part)
0
All Courses

From novice to tech pro — start learning today.