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. Debugging DAO to ADO Conversion Errors

Debugging DAO to ADO Conversion Errors

Scheduled Pinned Locked Moved Database
c++databasehelpquestionannouncement
8 Posts 2 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.
  • K Offline
    K Offline
    Kyudos
    wrote on last edited by
    #1

    I'm converting some old CDao classes to ADO (ODBC) for Access database handling. Part of my code copies a table record from one database to another. When I do the CRecordset::Update I get a CDBException that completely unhelpfully tells me:

    m_strError "String data, right truncated
    m_strStateNativeOrigin "State:22001,Native:31,Origin:[Microsoft][ODBC Microsoft Access Driver]

    Is there any way to get my code to tell me which field(s) is(are) causing the problem?

    M 1 Reply Last reply
    0
    • K Kyudos

      I'm converting some old CDao classes to ADO (ODBC) for Access database handling. Part of my code copies a table record from one database to another. When I do the CRecordset::Update I get a CDBException that completely unhelpfully tells me:

      m_strError "String data, right truncated
      m_strStateNativeOrigin "State:22001,Native:31,Origin:[Microsoft][ODBC Microsoft Access Driver]

      Is there any way to get my code to tell me which field(s) is(are) causing the problem?

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Kyudos wrote:

      right truncated

      I would check the length of everything, data, parameter, target field in the table.

      Never underestimate the power of human stupidity RAH

      K 1 Reply Last reply
      0
      • M Mycroft Holmes

        Kyudos wrote:

        right truncated

        I would check the length of everything, data, parameter, target field in the table.

        Never underestimate the power of human stupidity RAH

        K Offline
        K Offline
        Kyudos
        wrote on last edited by
        #3

        I tried that...I can't find it! :sigh: Surely the driver must 'know' where this happens - why can't it just tell me? :rolleyes:

        M 1 Reply Last reply
        0
        • K Kyudos

          I tried that...I can't find it! :sigh: Surely the driver must 'know' where this happens - why can't it just tell me? :rolleyes:

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          It is the same with SQL Server and has always been an irritant. With SQL Server you have sql profiler and you can trap the actual statement passed to the database including data. You can then manually execute the command in management studio. This gives you a more detailed error response and you can use the mark I eyeball to inspect the data. I know you can execute sql strings in Access but I do not know where to trap the command passed to the database from the client. I would strongly suggest moving the database from Access to SQL server if possible.

          Never underestimate the power of human stupidity RAH

          K 3 Replies Last reply
          0
          • M Mycroft Holmes

            It is the same with SQL Server and has always been an irritant. With SQL Server you have sql profiler and you can trap the actual statement passed to the database including data. You can then manually execute the command in management studio. This gives you a more detailed error response and you can use the mark I eyeball to inspect the data. I know you can execute sql strings in Access but I do not know where to trap the command passed to the database from the client. I would strongly suggest moving the database from Access to SQL server if possible.

            Never underestimate the power of human stupidity RAH

            K Offline
            K Offline
            Kyudos
            wrote on last edited by
            #5

            Mycroft Holmes wrote:

            I would strongly suggest moving the database from Access to SQL server if possible.

            That's impractical unfortunately.

            1 Reply Last reply
            0
            • M Mycroft Holmes

              It is the same with SQL Server and has always been an irritant. With SQL Server you have sql profiler and you can trap the actual statement passed to the database including data. You can then manually execute the command in management studio. This gives you a more detailed error response and you can use the mark I eyeball to inspect the data. I know you can execute sql strings in Access but I do not know where to trap the command passed to the database from the client. I would strongly suggest moving the database from Access to SQL server if possible.

              Never underestimate the power of human stupidity RAH

              K Offline
              K Offline
              Kyudos
              wrote on last edited by
              #6

              Mycroft Holmes wrote:

              I would strongly suggest moving the database from Access to SQL server if possible.

              That's impractical unfortunately. I've checked all the text field member lengths before and after the Update, they both match each other and the database definition. The are no problems in DoFieldExchange. I don't know what to do next...

              1 Reply Last reply
              0
              • M Mycroft Holmes

                It is the same with SQL Server and has always been an irritant. With SQL Server you have sql profiler and you can trap the actual statement passed to the database including data. You can then manually execute the command in management studio. This gives you a more detailed error response and you can use the mark I eyeball to inspect the data. I know you can execute sql strings in Access but I do not know where to trap the command passed to the database from the client. I would strongly suggest moving the database from Access to SQL server if possible.

                Never underestimate the power of human stupidity RAH

                K Offline
                K Offline
                Kyudos
                wrote on last edited by
                #7

                Hah! :-O My fault of course - I was checking the wrong database definition - I had a field the wrong length! oops!

                M 1 Reply Last reply
                0
                • K Kyudos

                  Hah! :-O My fault of course - I was checking the wrong database definition - I had a field the wrong length! oops!

                  M Offline
                  M Offline
                  Mycroft Holmes
                  wrote on last edited by
                  #8

                  Yah, done that well... yesterday actually!

                  Never underestimate the power of human stupidity RAH

                  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