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. General Programming
  3. C / C++ / MFC
  4. Updating DB table with CRecordset class

Updating DB table with CRecordset class

Scheduled Pinned Locked Moved C / C++ / MFC
databasecsssql-serversysadminhelp
5 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.
  • Z Offline
    Z Offline
    zinc_z
    wrote on last edited by
    #1

    Hi , I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class. I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type). I m creating my CRecordset class through wizard pointing to database table with ODBC. CString ppp; ppp="somevalue" tstRs->m_res = ppp; now if ppp is less than 255 it works fine but if its more than 255 characters I get exception . does anybody know whats wrong ? and how to send a string more than 255 using CRecordset ???? Thanks in advance. ZINC

    D L 2 Replies Last reply
    0
    • Z zinc_z

      Hi , I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class. I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type). I m creating my CRecordset class through wizard pointing to database table with ODBC. CString ppp; ppp="somevalue" tstRs->m_res = ppp; now if ppp is less than 255 it works fine but if its more than 255 characters I get exception . does anybody know whats wrong ? and how to send a string more than 255 using CRecordset ???? Thanks in advance. ZINC

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      zinc_z wrote:

      I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class. I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type).

      Access tells you right in its design view that a text field can be no larger than 255 characters. See the online specifications here. It's also listed in your ACMAIN11.CHM (or ACMAIN10.CHM) file.

      zinc_z wrote:

      ...I get exception .

      What's the exception?


      "The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli

      Z 1 Reply Last reply
      0
      • Z zinc_z

        Hi , I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class. I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type). I m creating my CRecordset class through wizard pointing to database table with ODBC. CString ppp; ppp="somevalue" tstRs->m_res = ppp; now if ppp is less than 255 it works fine but if its more than 255 characters I get exception . does anybody know whats wrong ? and how to send a string more than 255 using CRecordset ???? Thanks in advance. ZINC

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        An MS Access field of type Text is limited to 255 characters. If you want to store more than 255 characters, use a Memo field type. Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert.

        Z 1 Reply Last reply
        0
        • D David Crow

          zinc_z wrote:

          I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class. I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type).

          Access tells you right in its design view that a text field can be no larger than 255 characters. See the online specifications here. It's also listed in your ACMAIN11.CHM (or ACMAIN10.CHM) file.

          zinc_z wrote:

          ...I get exception .

          What's the exception?


          "The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli

          Z Offline
          Z Offline
          zinc_z
          wrote on last edited by
          #4

          it gives debug essertion failed at frxdb libraray.

          1 Reply Last reply
          0
          • L Lost User

            An MS Access field of type Text is limited to 255 characters. If you want to store more than 255 characters, use a Memo field type. Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert.

            Z Offline
            Z Offline
            zinc_z
            wrote on last edited by
            #5

            I am having the same problem in SQL Server table , where I m using Varchar 700 . I have tried different fields too , I think its may be the limitation of DoFieldExchange function that It can't send more than 255 characters to DB table ??? Any suggestion ?

            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