This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes memo field in Access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "memo field in Access" Watch "memo field in Access" New topic
Author

memo field in Access

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
How do I get the info out of a memo field in Access? I am using resultSet.getString(...) It keeps coming back with an error. I seem to recall somewhere else reading that there was a problem with memo fields, but I haven't come across a solution.
thanks
Milind Kulkarni
Ranch Hand

Joined: Jun 01, 2000
Posts: 146
Hi Brian,
I think you should refer to driver documentation for accessing memo field in access.
Regards,
Milind
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I was just using the jsbd dbc bridge that comes with Java. Is there a way to do it using sun's driver, or do I need to get a driver specialized for MS Access?
Milind Kulkarni
Ranch Hand

Joined: Jun 01, 2000
Posts: 146
Hi Brian,
What kind of problem are you experiencing? A fix has been made in JDBC-ODBC bridge in the latest version of JDK (1.3) to solve OutOfMemory exception when getString() is used on a Memo field of MS Access. Check out this URL for the details: http://java.sun.com/j2se/1.3/fixedbugs/1.3.0/index.html
Regards,
Milind
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I was not sure what is a memo field. I got the following from Microsoft help.
Use the Memo data type if you need to store more than 255 characters. A Memo field can store up to 64,000 characters. Memo fields can't be indexed or sorted.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I had to use getAsciiStream() and setAsciiStream() for memo fields. actually, I never had any trouble reading the memo fields, but have always got "right truncated" exceptions when trying to write memo > 2025 bytes; but it was simpler for me to use the stream routines for both reading and writing ( I could get by with just the setAsciiStream() routine ).
By all means, you should make sure that you are using JDK 1.3, because there were some other SQL related problems with 1.2.2, most notably to me was erroneous "Function Out of Sequence" errors.
MarkB
Greenhorn

Joined: Sep 30, 2002
Posts: 2
This worked for me:
BufferedReader br = new BufferedReader(new InputStreamReader(rs.getAsciiStream("Your Field Name")));
comments = br.readLine();
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: memo field in Access
 
Similar Threads
Memo field in SQL
memo field in SQL
Servlet-JDBC with Access databse
How do I store an Access Memo field in a Hashtable
Servlet-JDBC with Access databse