Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Cannot insert Large text into Database Memo field

Reply
Thread Tools

Cannot insert Large text into Database Memo field

 
 
Olaf Winterton
Guest
Posts: n/a
 
      01-05-2004
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.
 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      01-05-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.



 
Reply With Quote
 
 
 
 
Olaf Winterton
Guest
Posts: n/a
 
      01-05-2004
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!
 
Reply With Quote
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      01-05-2004
Apostrophes:
http://www.aspfaq.com/2035

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




"Olaf Winterton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!



 
Reply With Quote
 
Olaf Winterton
Guest
Posts: n/a
 
      01-05-2004
You're the man Aaron.



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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to store/ retrieve display rich text using access memo field rajpsmohan@googlemail.com ASP General 4 04-06-2009 10:55 AM
How to insert binary to memo haste C++ 2 02-01-2006 10:44 AM
Update Access Memo field from ASP.NET =?Utf-8?B?TWF0dA==?= ASP .Net 6 04-11-2005 01:22 PM
How to handle Memo/text field in Mysql with Asp Lakshmi Narayanan.r ASP General 1 12-22-2003 06:53 AM
Content from a memo field: converting the rich text into plain text Alfredo Agosti ASP General 3 09-19-2003 05:01 PM



Advertisments