473,699 Members | 2,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot insert Large text into Database Memo field

I'm trying to insert this text into a memo field:

Set cnn = CreateObject("A DODB.Connection ")
str = Server.MapPath( "database/alumni.mdb")
strDB = "Provider=MICRO SOFT.JET.OLEDB. 4.0;Data Source=" & str
cnn.Open strDB
Set rst = CreateObject("A DODB.Recordset" )

sql = "INSERT INTO tblMessage (MessageID, UserID, PostTypeID, Subject,
DatePosted, MessageText, Active) Values ('" & vMessageID & "','" &
vUser & "', " & vPostType & ",'" & vSubject & "','" & vDatePosted &
"','" & vMessageText & "',0)"

rst.Open sql, cnn, adOpenStatic, adLockOptimisti c

vMessageText = "This is a test just to see if it will blow up on a
large comment. Just testing again. Don't mind me."

Can I put this into my database field or is it too much and if not,
how do I solve this issue. I need to be able to post messages and
input for large fields.
Jul 19 '05 #1
4 3384
Why are you using a recordset, and specifying cursors/locks? Recordsets are
for *retrieving* data, not affecting data. Change your rst open line to the
following:

cnn.execute sql, , 129

And get rid of the set rst = line.

If this does not work, post what "doesn't work" means.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Olaf Winterton" <ow********@yah oo.com> wrote in message
news:b8******** *************** ***@posting.goo gle.com...
I'm trying to insert this text into a memo field:

Set cnn = CreateObject("A DODB.Connection ")
str = Server.MapPath( "database/alumni.mdb")
strDB = "Provider=MICRO SOFT.JET.OLEDB. 4.0;Data Source=" & str
cnn.Open strDB
Set rst = CreateObject("A DODB.Recordset" )

sql = "INSERT INTO tblMessage (MessageID, UserID, PostTypeID, Subject,
DatePosted, MessageText, Active) Values ('" & vMessageID & "','" &
vUser & "', " & vPostType & ",'" & vSubject & "','" & vDatePosted &
"','" & vMessageText & "',0)"

rst.Open sql, cnn, adOpenStatic, adLockOptimisti c

vMessageText = "This is a test just to see if it will blow up on a
large comment. Just testing again. Don't mind me."

Can I put this into my database field or is it too much and if not,
how do I solve this issue. I need to be able to post messages and
input for large fields.

Jul 19 '05 #2
Thanks Aaron, that fixed my problem. Sorry for such a newbie problem.
That seemingly has solved the problem. For some reason I was having
trouble storing large text inputs with punctuation. I'm not sure about
apostrophes, but now commas, periods, and any other punctuations seem to
work. Thanks again.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
Apostrophes:
http://www.aspfaq.com/2035

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Olaf Winterton" <ow********@yah oo.com> wrote in message
news:O5******** ******@TK2MSFTN GP12.phx.gbl...
Thanks Aaron, that fixed my problem. Sorry for such a newbie problem.
That seemingly has solved the problem. For some reason I was having
trouble storing large text inputs with punctuation. I'm not sure about
apostrophes, but now commas, periods, and any other punctuations seem to
work. Thanks again.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #4
You're the man Aaron.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #5

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

Similar topics

3
8674
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo field in plain text. That's because I truncate the string text but if, when I truncate it there's a rich tag the code following the truncated string is corrupted. Don't know if it's clear enough.
1
1684
by: RR | last post by:
Is there a way to combine text fields into one memo field? This is an existing database. Some people in the database may have several "contact" entries where they have a "note" in a text field. I would like to figure a way to combine all the "note" fields for each person into one memo field. Thank you
0
1748
by: htmlgeek | last post by:
I'm adding and updating records in an Access .mdb via WWW .asp page. Authored in Dreamweaver 2004 MX. Help is welcome on this one. I have a great set of pages that work fine, but it seems that insert or update pages don't always work now on some records . . . It seems that when lots of text is shoved into a memo fields the database ID for that record gets messed up. Intial record insertion goes OK, but updating is then hosed.
4
2389
by: steverossiter | last post by:
Hi and thanks, I have a Journalist database for tracking writers from various magazines and would like a field that could hold the text of their articles as they are published. The Memo field would allow 65K characters but with time even this would not provide the necessary space. The field need not hold graphics, although that would be nice if possible, and I will not need to run queries against it. It is simply
7
2020
by: Ryker | last post by:
I have a form where "notes" are entered on an individual. Unfortunately, these notes are usually longer than the 255 characters allowed in a single text box. To get around this, I have three note boxes set up on the form (note1, note2, and note3). When one fills up, the user can tab to the next one and continue typing. This works but it is very cumbersome and sloppy. Is there an easier way?
10
3052
by: ARC | last post by:
This is mainly a speed question. In this example: I have a QuotesHdr table that has a few memo fields. If these memo fields are used extensively by some users, and if their are a large number of records in QuotesHdr, should I break out the memo fields into a separate table? The thinking here is that, for Quotes selection dropdowns that display all entries in QuotesHdr for selection, I would think that the entire record comes down over...
25
20555
by: tekctrl | last post by:
Anyone: I have a simple MSAccess DB which was created from an old ASCII flatfile. It works fine except for something that just started happening. I'll enter info in a record, save the record, and try to move to another record and get an Access error "Record is too large". The record is only half filled, with many empty fields. If I remove the added data or delete some older data, then it saves ok and works fine again. Whenever I'm...
5
7872
by: betaphase | last post by:
I am new to Access and I'm having trouble with a database someone else created. I am wondring why I am not being able to insert more than 255 characters to a memo field in Access 2003. We need a field in our database to allow us to enter a short summary of the job we are referencing. I can format the "data type" of the entry to be a "memo" which I thought should give me plenty of space to get the summary in. I can set the field to "memo"...
17
12752
by: mandanarchi | last post by:
Access 2003; PC with Windows XP; SBS 2003 I tried searching the forums but it came up with a blank page. I searched Google and found an answer; but the 'problem' doesn't relate to our situation! We have a table with 24 fields; 1 AutoNumber; 1 Yes/No; 1 Memo; 2 Currency; 5 Number and the rest Text. The AutoNumber (PK), one Text (No Duplicatess) and one of the Number fields (Duplicates OK) are indexed. There is a form to add records to...
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9171
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8905
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4373
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.