M
MSDevelOlap
I am using a recordset to retrieve data from an Access table.
The memo field in the table can hold more than 255 chars, but I
only retrieve the first 255. I have read about GetChunk and attempted
to fix the problem, but the same effect occurs. The code follows:
Dim DB As Database
Dim TB As Recordset
Dim ServiceNotes As String
Dim lngOffset As Long
Dim lngTotalSize As Long
Dim strChunk As String
Set DB = DBEngine(0)(0)
Set TB = DB.OpenRecordset("TSO Details", DB_OPEN_DYNASET)
On Error Resume Next
TB.MoveFirst
On Error GoTo 0
Do Until TB.EOF
Forms![TSO Details]![Service Resolution] = TB.Fields("Service
Resolution")
conChunkSize = 32768
lngTotalSize = TB.Fields("Service Notes").FieldSize
Do While lngOffset < lngTotalSize
strChunk = TB.Fields("Service Notes").GetChunk(lngOffset,
conChunkSize)
ServiceNotes = ServiceNotes & strChunk
lngOffset = lngOffset + conChunkSize
Loop
Forms![TSO Details]![Service Notes] = ServiceNotes
TB.MoveNext
Loop
Forms![TSO Details].Refresh
TB.Close
DB.Close
Please post any suggestions.
Thank you.
The memo field in the table can hold more than 255 chars, but I
only retrieve the first 255. I have read about GetChunk and attempted
to fix the problem, but the same effect occurs. The code follows:
Dim DB As Database
Dim TB As Recordset
Dim ServiceNotes As String
Dim lngOffset As Long
Dim lngTotalSize As Long
Dim strChunk As String
Set DB = DBEngine(0)(0)
Set TB = DB.OpenRecordset("TSO Details", DB_OPEN_DYNASET)
On Error Resume Next
TB.MoveFirst
On Error GoTo 0
Do Until TB.EOF
Forms![TSO Details]![Service Resolution] = TB.Fields("Service
Resolution")
conChunkSize = 32768
lngTotalSize = TB.Fields("Service Notes").FieldSize
Do While lngOffset < lngTotalSize
strChunk = TB.Fields("Service Notes").GetChunk(lngOffset,
conChunkSize)
ServiceNotes = ServiceNotes & strChunk
lngOffset = lngOffset + conChunkSize
Loop
Forms![TSO Details]![Service Notes] = ServiceNotes
TB.MoveNext
Loop
Forms![TSO Details].Refresh
TB.Close
DB.Close
Please post any suggestions.
Thank you.