Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Text from VB to a Memo field in Access

Status
Not open for further replies.

jfrost10

Programmer
Jun 3, 2001
2,004
CA
hi guys,

I have a memo field in my access db, but I can't figure out how to get a variable holding text from the vb app to the database, mainly because the string can only hold 255 characters. Is there another datatype in vb that can accomodate the amount of data a memo can hold?

I'm also doing this using classes, so it does have to go through code, not just adodb control.

Thanks,

Jack
 
Jack,

Using the VBA of Access 2000 would be the best bet for this solution. Since you are use Access the limit is 255 characters. If you can break down the memo text in to many based on the type. Then you can "break" the limit. Will this be internal data or external. If you can show me some of the code, I'm more then happy to help out.

Aaron
 
Hi Aaron, thanks for the response.

I don't have any code yet as I'm just doing the UML/Designing aspects of hte project, but here's a summary of what will happen:
1. Form loads and creates instnce of an object.
2. User enters text in a text box on a VB form
3. User click save, which assigns the value of the text
box to a corresponding value in teh object.
4. Object's save command is executed, and it opens a record-
set and saves the data to a local access db.

So my question is: Do I have to have multiple text boxes with max length of 255, and just compound the three of them when I save to the memo datatype field in the access db, or is there a way from within vb to assign a massive amount of text to something (a variant maybe?)so it can pass through and work around the string's 255 limitations?

Thanks again,

J
 
Jack,

The best bet is if you can break it down to multi memo boxes and let the user have check box option for if it will have a null value. So you can get more specific details in the responses???

Aaron
 
jfrost10, you don't need to use multiple text boxes at all. You can use the AppendChunk method to insert BLOBs into your memo type field on MS Access.

To see how this work, have a look at:


Other way of accomplish this would be to use the stream object, but I'm not sure that it would work on this case(Never worked with it on memo fields).

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top