Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Memo field not returning more than 256 characters.

Memo field not returning more than 256 characters.

Scheduled Pinned Locked Moved Database
databasequestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    brdavid
    wrote on last edited by
    #1

    with the following call vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; where lpFieldName is type "memo", I am only getting the first 256 character returned to the variant variable vtFld. I am using MS Access as my database editor which in turn uses JET as the database. Might anyone know why I'm am only getting the first 256 characters returned? I checked all of the fields in vtFld and all the relavent ones contain the returned truncated string. Thanks!

    N E 2 Replies Last reply
    0
    • B brdavid

      with the following call vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; where lpFieldName is type "memo", I am only getting the first 256 character returned to the variant variable vtFld. I am using MS Access as my database editor which in turn uses JET as the database. Might anyone know why I'm am only getting the first 256 characters returned? I checked all of the fields in vtFld and all the relavent ones contain the returned truncated string. Thanks!

      N Offline
      N Offline
      Nemanja Trifunovic
      wrote on last edited by
      #2

      Do you use ODBC recordsets? I recently run into the same problem when working with DTL (uses ODBC under the hood), and found the solution here[^]


      My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.

      B 1 Reply Last reply
      0
      • N Nemanja Trifunovic

        Do you use ODBC recordsets? I recently run into the same problem when working with DTL (uses ODBC under the hood), and found the solution here[^]


        My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.

        B Offline
        B Offline
        brdavid
        wrote on last edited by
        #3

        I'm using ADO recordsets.

        1 Reply Last reply
        0
        • B brdavid

          with the following call vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value; where lpFieldName is type "memo", I am only getting the first 256 character returned to the variant variable vtFld. I am using MS Access as my database editor which in turn uses JET as the database. Might anyone know why I'm am only getting the first 256 characters returned? I checked all of the fields in vtFld and all the relavent ones contain the returned truncated string. Thanks!

          E Offline
          E Offline
          EdbertP
          wrote on last edited by
          #4

          Did you use aggregate functions (SUM, AVG, MAX, COUNT, etc) in your sql statement? Also a memo field will be truncated to 255 characters in a query that uses sorting (ORDER BY).

          B 1 Reply Last reply
          0
          • E EdbertP

            Did you use aggregate functions (SUM, AVG, MAX, COUNT, etc) in your sql statement? Also a memo field will be truncated to 255 characters in a query that uses sorting (ORDER BY).

            B Offline
            B Offline
            brdavid
            wrote on last edited by
            #5

            Well, I guess there are a couple things I am noticing. To answer the questions above, no, I am not using any aggregate functions and there isn't an ORDER BY in the statement. However, I have other memo fields in other tables which return more than 256 fields when called through ADO, which makes we wonder about the table itself. Does anyone know what might cause a single table to cause these issues? One thing that is different in this table is that there are relationships mapped to it. thanks! :)

            E 1 Reply Last reply
            0
            • B brdavid

              Well, I guess there are a couple things I am noticing. To answer the questions above, no, I am not using any aggregate functions and there isn't an ORDER BY in the statement. However, I have other memo fields in other tables which return more than 256 fields when called through ADO, which makes we wonder about the table itself. Does anyone know what might cause a single table to cause these issues? One thing that is different in this table is that there are relationships mapped to it. thanks! :)

              E Offline
              E Offline
              EdbertP
              wrote on last edited by
              #6

              Well, some people also suggested that there's a bug when calling memo fields. They recommend either getting a column for every 256 chars (using MID) :wtf: Others recommend calling the GetChunk() function. It takes a long as argument, so you should be able to get everything using it. Here's a sample of the function called in ASP:

              set rst = conn.execute("select job_title, job_descr from jobs")
              strTitle = rst.Fields("job_title").value & ""
              vChunk = rst.Fields("job_descr").GetChunk(4000)
              strDescr = vChunk
              Do Until IsNull(vChunk) = true
              vChunk = rst.Fields("job_descr").GetChunk(4000)
              vDescr = vDescr & vChunk
              Loop

              Hope it helps! :-D

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups