Saving long text in a memo field

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Re: Saving long text in a memo field

    Sajid wrote:
    > Hi All
    >
    > I am developing a website using asp and access. I have some pages in
    > which user can type very long text in a textarea and submit it. The
    > long text is saved in a memo field. When text is small (e.g. 1000
    > characters), it is saved (as well modified) successfully. But when I
    > try to submit very long data (e.g. 4000 characters), it generates
    > following error:
    >
    > [Microsoft][ODBC Microsoft Access Driver] Could not save; currently
    > locked by user 'admin' on machine 'ABC'.
    >
    > and the error number is 2147467259.
    >
    > If someone could help in this regard. I'll be very thankful.
    >
    > Regards
    > Sajid
    I've never run across this situation. My first suggestion would be to switch
    from ODBC to OLEDB. Here is a sample connection string you could use (other
    examples can be found at [url]www.able-consulting.com/ado_conn.htm):[/url]

    oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=c:\somepath\myDb.mdb;"

    I just ran a test with this code:

    <%
    dim cn,sMemo, sSQL
    set cn=server.createobject("adodb.connection")
    cn.Open "provider=microsoft.jet.oledb.4.0;data source=" & _
    server.MapPath("db7.mdb")
    sMemo=string(4000,"x")
    sSQL="INSERT INTO TestTable(memofield) VALUES ('" & _
    sMemo & "')"
    cn.Execute sSQL,,129
    %>

    The 4000 x's were inserted with no problem. I then tried an update:
    sMemo=string(4000,"y")
    sSQL="UPDATE TestTable SET memofield='" & sMemo & "'"
    cn.Execute sSQL,,129

    Please try my suggestion of switching to OLEDB. If that does not solve your
    problem, post some code to show me how to reproduce the problem.

    Bob Barrows
    PS. Since this is an ASP and database question, I've cp'ed and set followups
    to microsoft.public.inetserver.asp.db
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows Guest

  2. Similar Questions and Discussions

    1. Query error saving to Memo field ...
      <cfqueryparam cfsqltype="CF_SQL_LONGVARCHAR" value="#arguments.details.CONTENT#"> let me save properly to Memo field unless "CONTENT" length is more...
    2. CFMX 7 SQL TEXT FIELD Long Text Retrieval
      I have CFMX 7 Developer Edition on my development box and CFMX 7 Standard on a production box. I have a text field on my SQL server which contains...
    3. Postgresql Text field / Visual FoxPro Memo and ODBC
      On Wed, 2005-01-12 at 14:59, MargaretGillon@chromalloy.com wrote: Postgresql doesn't support updatable cursors. ---------------------------(end...
    4. Content from a memo field: converting the rich text into plain text
      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...
    5. losing text in memo field when double-spacing
      Hi, I'm working in Access 2000 with a db that has a lot of text. When I change the line spacing to .1" (properties box, format tab) in memo...
  3. #2

    Default Re: Saving long text in a memo field

    Sajid wrote:
    > ************************
    > Database Manupulation Functions
    > ************************
    >
    > sub openDb()
    > if varType(connTemp)=0 or varType(connTemp)=1 then
    >
    > ' create the connection
    > set connTemp = server.createObject("adodb.connection")
    >
    > connTemp.Open Application("myDSN")
    >
    >\
    I see you have not taken my suggestion to try the native Jet OLEDB provider
    instead of the obsolete ODBC DSN. Please give that a try.

    Bob Barrows



    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139