473,396 Members | 1,995 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,396 software developers and data experts.

Cannot insert Large text into Database Memo field

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

Set cnn = CreateObject("ADODB.Connection")
str = Server.MapPath("database/alumni.mdb")
strDB = "Provider=MICROSOFT.JET.OLEDB.4.0;Data Source=" & str
cnn.Open strDB
Set rst = CreateObject("ADODB.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, adLockOptimistic

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 3369
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********@yahoo.com> wrote in message
news:b8**************************@posting.google.c om...
I'm trying to insert this text into a memo field:

Set cnn = CreateObject("ADODB.Connection")
str = Server.MapPath("database/alumni.mdb")
strDB = "Provider=MICROSOFT.JET.OLEDB.4.0;Data Source=" & str
cnn.Open strDB
Set rst = CreateObject("ADODB.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, adLockOptimistic

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********@yahoo.com> wrote in message
news:O5**************@TK2MSFTNGP12.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
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...
1
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. ...
0
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...
4
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...
7
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...
10
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...
25
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,...
5
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...
17
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!...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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
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...
0
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,...

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.