469,280 Members | 1,868 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,280 developers. It's quick & easy.

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 3246
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by RR | last post: by
4 posts views Thread by steverossiter | last post: by
7 posts views Thread by Ryker | last post: by
25 posts views Thread by tekctrl | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.