473,441 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

OleDbDataReader and MS Access Memo Field


Ok I am trying to read a memo field from an Access DB
that has more than 255 char. I am only getting 255 chars
back from the reader. Why is this and how do i get the
whole memo field. Here is a piece of the code I am using

Do While m_oleDBReader.Read()

var = m_oleDBReader("memo_field")

Loop

m_oleDBReader.Close()

Rich

Jul 21 '05 #1
1 7092
On Wed, 26 Nov 2003 14:05:54 -0800, "Rich" <rk*@companyabc.com> wrote:

¤
¤ Ok I am trying to read a memo field from an Access DB
¤ that has more than 255 char. I am only getting 255 chars
¤ back from the reader. Why is this and how do i get the
¤ whole memo field. Here is a piece of the code I am using
¤
¤ Do While m_oleDBReader.Read()
¤
¤ var = m_oleDBReader("memo_field")
¤
¤ Loop
¤
¤ m_oleDBReader.Close()

Try the following:

Sub ReadMemoFromAccess()

Dim retVal As Long
Dim FieldLen As Int32

Dim MemoCol As Integer = 1 ' the column # of the Memo field in the query
Dim AccessConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=e:\My Documents\db1.mdb")
Dim AccessCommand As New OleDbCommand("SELECT [record ID], MemoField FROM Table1 WHERE
[record id] = 1", AccessConnection)
AccessConnection.Open()
Dim dr As OleDbDataReader = AccessCommand.ExecuteReader(CommandBehavior.Sequen tialAccess)
dr.Read()
FieldLen = dr.Item(MemoCol).Length
Dim MemoBuffer(FieldLen - 1) As Char
Dim startIndex As Integer = 0
retVal = dr.GetChars(1, startIndex, MemoBuffer, 0, MemoBuffer.Length)
Console.WriteLine(MemoBuffer)
dr.Close()
AccessConnection.Close()

End Sub
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: intl04 | last post by:
I have a memo field that is included in some Access reports I created. Is there some way for the memo field to display nicely formatted text, with line breaks between paragraphs? Or is it necessary...
28
by: Lee Rouse | last post by:
Hello all, This is going to be a rather lengthy "question". I have an Access 2k database, separated front end/back end. Front end copies are on about 30 workstations and used frequently during...
10
by: mbev | last post by:
I would like to have in a field a big amount of text with a size more than 64K. This field will have text and HTML tags. Is there a way to do this in access? Ok, I may be I need to explain myself...
0
by: htmlgeek | last post by:
I've beaten my head againts this for two weeks and would appreciate any help. Am running Dreamweaver 2004 MX asp pages with MS Access 2000 and then 2003 and received same problems! I've rebuilt...
6
by: Matt | last post by:
I'm having difficulty with trying to update a Access memo field through an SQL statement where the value I'm trying to pass is longer than 255 characters. The field is being truncated. I'm using...
1
by: Rich | last post by:
Ok I am trying to read a memo field from an Access DB that has more than 255 char. I am only getting 255 chars back from the reader. Why is this and how do i get the whole memo field. Here is a...
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
13
by: Owen Jenkins | last post by:
Following on from an earlier post... I can reliably corrupt a record by doing the following ... Open two separate but identical front ends on one PC each linking to the same back end. Edit a...
2
by: steph | last post by:
I have a table with 250 fields. Of course you are wondering why 250 fields... what could I possibly be storing in so many fields? I am using this table as a general import table for files that...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.