Cannot insert Large text into Database Memo field

Discussion in 'ASP General' started by Olaf Winterton, Jan 5, 2004.

  1. 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.
     
    Olaf Winterton, Jan 5, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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.
     
    Aaron Bertrand - MVP, Jan 5, 2004
    #2
    1. Advertising

  3. 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!
     
    Olaf Winterton, Jan 5, 2004
    #3
  4. Apostrophes:
    http://www.aspfaq.com/2035

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




    "Olaf Winterton" <> wrote in message
    news:...
    > 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!
     
    Aaron Bertrand - MVP, Jan 5, 2004
    #4
  5. You're the man Aaron.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Olaf Winterton, Jan 5, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWF0dA==?=

    Update Access Memo field from ASP.NET

    =?Utf-8?B?TWF0dA==?=, Apr 11, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    5,989
    =?Utf-8?B?TWF0dA==?=
    Apr 11, 2005
  2. haste
    Replies:
    2
    Views:
    364
    Bob Hairgrove
    Feb 1, 2006
  3. Alfredo Agosti
    Replies:
    3
    Views:
    353
    Aaron Bertrand - MVP
    Sep 19, 2003
  4. Lakshmi Narayanan.r

    How to handle Memo/text field in Mysql with Asp

    Lakshmi Narayanan.r, Dec 22, 2003, in forum: ASP General
    Replies:
    1
    Views:
    261
    Ray at
    Dec 22, 2003
  5. Replies:
    4
    Views:
    395
    Bob Barrows
    Apr 6, 2009
Loading...

Share This Page