473,320 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 7082
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.