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. CRecordset

CRecordset

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelptutorialquestionannouncement
7 Posts 5 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
    Bravoone_2006
    wrote on last edited by
    #1

    how to open a query with just 3 columns? .my database contains 40 i think more... and when i try to update i have this error: SQL: Statement too long, because this is my statement: SELECT `cont`,`den`,`tip`,`fel`,`listare`,`carte`,`formular`,`rand`,`inchid`,`sid0`,`sid1`,`sid2`,`sid3`,`sid4`,`sid5`,`sid6`,`sid7`,`sid8`,`sid9`,`sid10`,`sid11`,`sid12`,`sid13`,`sic0`,`sic1`,`sic2`,`sic3`,`sic4`,`sic5`,`sic6`,`sic7`,`sic8`,`sic9`,`sic10`,`sic11`,`sic12`,`sic13`,`rld1`,`rld2`,`rld3`,`rld4`,`rld5`,`rld6`,`rld7`,`rld8`,`rld9`,`rld10`,`rld11`,`rld12`,`rlc1`,`rlc2`,`rlc3`,`rlc4`,`rlc5`,`rlc6`,`rlc7`,`rlc8`,`rlc9`,`rlc10`,`rlc11`,`rlc12`,`rcd0`,`rcd1`,`rcd2`,`rcd3`,`rcd4`,`rcd5`,`rcd6`,`rcd7`,`rcd8`,`rcd9`,`rcd10`,`rcd11`,`rcd12`,`rcc0`,`rcc1`,`rcc2`,`rcc3`,`rcc4`,`rcc5`,`rcc6`,`rcc7`,`rcc8`,`rcc9`,`rcc10`,`rcc11`,`rcc12`,`obs`,`codfiscal`,`fact`,`data_fact`,`data_scad`,`mag`,`rata`,`marca`,`verificat`,`i0`,`i1`,`i2`,`i3`,`i4`,`i5`,`i6`,`i7`,`i8`,`i9`,`i10`,`i11`,`i12`,`sold_vechi`,`sold_nou`,`l`,`curs_ini`,`data_curs`,`moneda`,`cont_conv`,`val_conv`,`curs_ref`,`r1`,`r2`,`r3`,`r4`,`r5`,`r6`,`r7`,`r8`,`r9`,`r10`,`r11`,`r12`,`nr_rate_r`,`tva`,`inceput`,`terminat`,`curs_fin`,`s_v_ini`,`bi`,`v_tva` FROM `2006tert` WHERE fact=1978 how to write an sql statement when i try to open CString sQLW = ("SELECT................ what? CDatabase_ALS pRo; pRo.Open(CDatabase_ALS::snapshot,sQLW); this statement it came from this CString sX = pRo.GetSQL(); m_lop.SetWindowText(sX); and this i have seen my select statement because i dont write it! all i want is to edit a field from cont ! ???????????????????????????????????????????????????????

    Bravoone

    R H V M 4 Replies Last reply
    0
    • B Bravoone_2006

      how to open a query with just 3 columns? .my database contains 40 i think more... and when i try to update i have this error: SQL: Statement too long, because this is my statement: SELECT `cont`,`den`,`tip`,`fel`,`listare`,`carte`,`formular`,`rand`,`inchid`,`sid0`,`sid1`,`sid2`,`sid3`,`sid4`,`sid5`,`sid6`,`sid7`,`sid8`,`sid9`,`sid10`,`sid11`,`sid12`,`sid13`,`sic0`,`sic1`,`sic2`,`sic3`,`sic4`,`sic5`,`sic6`,`sic7`,`sic8`,`sic9`,`sic10`,`sic11`,`sic12`,`sic13`,`rld1`,`rld2`,`rld3`,`rld4`,`rld5`,`rld6`,`rld7`,`rld8`,`rld9`,`rld10`,`rld11`,`rld12`,`rlc1`,`rlc2`,`rlc3`,`rlc4`,`rlc5`,`rlc6`,`rlc7`,`rlc8`,`rlc9`,`rlc10`,`rlc11`,`rlc12`,`rcd0`,`rcd1`,`rcd2`,`rcd3`,`rcd4`,`rcd5`,`rcd6`,`rcd7`,`rcd8`,`rcd9`,`rcd10`,`rcd11`,`rcd12`,`rcc0`,`rcc1`,`rcc2`,`rcc3`,`rcc4`,`rcc5`,`rcc6`,`rcc7`,`rcc8`,`rcc9`,`rcc10`,`rcc11`,`rcc12`,`obs`,`codfiscal`,`fact`,`data_fact`,`data_scad`,`mag`,`rata`,`marca`,`verificat`,`i0`,`i1`,`i2`,`i3`,`i4`,`i5`,`i6`,`i7`,`i8`,`i9`,`i10`,`i11`,`i12`,`sold_vechi`,`sold_nou`,`l`,`curs_ini`,`data_curs`,`moneda`,`cont_conv`,`val_conv`,`curs_ref`,`r1`,`r2`,`r3`,`r4`,`r5`,`r6`,`r7`,`r8`,`r9`,`r10`,`r11`,`r12`,`nr_rate_r`,`tva`,`inceput`,`terminat`,`curs_fin`,`s_v_ini`,`bi`,`v_tva` FROM `2006tert` WHERE fact=1978 how to write an sql statement when i try to open CString sQLW = ("SELECT................ what? CDatabase_ALS pRo; pRo.Open(CDatabase_ALS::snapshot,sQLW); this statement it came from this CString sX = pRo.GetSQL(); m_lop.SetWindowText(sX); and this i have seen my select statement because i dont write it! all i want is to edit a field from cont ! ???????????????????????????????????????????????????????

      Bravoone

      R Offline
      R Offline
      Ray Kinsella
      wrote on last edited by
      #2

      Use a stored procedure perhaps ?

      Regards Ray "Je Suis Mort De Rire" Blogging @ Keratoconus Watch

      1 Reply Last reply
      0
      • B Bravoone_2006

        how to open a query with just 3 columns? .my database contains 40 i think more... and when i try to update i have this error: SQL: Statement too long, because this is my statement: SELECT `cont`,`den`,`tip`,`fel`,`listare`,`carte`,`formular`,`rand`,`inchid`,`sid0`,`sid1`,`sid2`,`sid3`,`sid4`,`sid5`,`sid6`,`sid7`,`sid8`,`sid9`,`sid10`,`sid11`,`sid12`,`sid13`,`sic0`,`sic1`,`sic2`,`sic3`,`sic4`,`sic5`,`sic6`,`sic7`,`sic8`,`sic9`,`sic10`,`sic11`,`sic12`,`sic13`,`rld1`,`rld2`,`rld3`,`rld4`,`rld5`,`rld6`,`rld7`,`rld8`,`rld9`,`rld10`,`rld11`,`rld12`,`rlc1`,`rlc2`,`rlc3`,`rlc4`,`rlc5`,`rlc6`,`rlc7`,`rlc8`,`rlc9`,`rlc10`,`rlc11`,`rlc12`,`rcd0`,`rcd1`,`rcd2`,`rcd3`,`rcd4`,`rcd5`,`rcd6`,`rcd7`,`rcd8`,`rcd9`,`rcd10`,`rcd11`,`rcd12`,`rcc0`,`rcc1`,`rcc2`,`rcc3`,`rcc4`,`rcc5`,`rcc6`,`rcc7`,`rcc8`,`rcc9`,`rcc10`,`rcc11`,`rcc12`,`obs`,`codfiscal`,`fact`,`data_fact`,`data_scad`,`mag`,`rata`,`marca`,`verificat`,`i0`,`i1`,`i2`,`i3`,`i4`,`i5`,`i6`,`i7`,`i8`,`i9`,`i10`,`i11`,`i12`,`sold_vechi`,`sold_nou`,`l`,`curs_ini`,`data_curs`,`moneda`,`cont_conv`,`val_conv`,`curs_ref`,`r1`,`r2`,`r3`,`r4`,`r5`,`r6`,`r7`,`r8`,`r9`,`r10`,`r11`,`r12`,`nr_rate_r`,`tva`,`inceput`,`terminat`,`curs_fin`,`s_v_ini`,`bi`,`v_tva` FROM `2006tert` WHERE fact=1978 how to write an sql statement when i try to open CString sQLW = ("SELECT................ what? CDatabase_ALS pRo; pRo.Open(CDatabase_ALS::snapshot,sQLW); this statement it came from this CString sX = pRo.GetSQL(); m_lop.SetWindowText(sX); and this i have seen my select statement because i dont write it! all i want is to edit a field from cont ! ???????????????????????????????????????????????????????

        Bravoone

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        if you want to read some cols you can simply enter names of cols Select col1,col2,col3 from table1


        WhiteSky


        B 1 Reply Last reply
        0
        • B Bravoone_2006

          how to open a query with just 3 columns? .my database contains 40 i think more... and when i try to update i have this error: SQL: Statement too long, because this is my statement: SELECT `cont`,`den`,`tip`,`fel`,`listare`,`carte`,`formular`,`rand`,`inchid`,`sid0`,`sid1`,`sid2`,`sid3`,`sid4`,`sid5`,`sid6`,`sid7`,`sid8`,`sid9`,`sid10`,`sid11`,`sid12`,`sid13`,`sic0`,`sic1`,`sic2`,`sic3`,`sic4`,`sic5`,`sic6`,`sic7`,`sic8`,`sic9`,`sic10`,`sic11`,`sic12`,`sic13`,`rld1`,`rld2`,`rld3`,`rld4`,`rld5`,`rld6`,`rld7`,`rld8`,`rld9`,`rld10`,`rld11`,`rld12`,`rlc1`,`rlc2`,`rlc3`,`rlc4`,`rlc5`,`rlc6`,`rlc7`,`rlc8`,`rlc9`,`rlc10`,`rlc11`,`rlc12`,`rcd0`,`rcd1`,`rcd2`,`rcd3`,`rcd4`,`rcd5`,`rcd6`,`rcd7`,`rcd8`,`rcd9`,`rcd10`,`rcd11`,`rcd12`,`rcc0`,`rcc1`,`rcc2`,`rcc3`,`rcc4`,`rcc5`,`rcc6`,`rcc7`,`rcc8`,`rcc9`,`rcc10`,`rcc11`,`rcc12`,`obs`,`codfiscal`,`fact`,`data_fact`,`data_scad`,`mag`,`rata`,`marca`,`verificat`,`i0`,`i1`,`i2`,`i3`,`i4`,`i5`,`i6`,`i7`,`i8`,`i9`,`i10`,`i11`,`i12`,`sold_vechi`,`sold_nou`,`l`,`curs_ini`,`data_curs`,`moneda`,`cont_conv`,`val_conv`,`curs_ref`,`r1`,`r2`,`r3`,`r4`,`r5`,`r6`,`r7`,`r8`,`r9`,`r10`,`r11`,`r12`,`nr_rate_r`,`tva`,`inceput`,`terminat`,`curs_fin`,`s_v_ini`,`bi`,`v_tva` FROM `2006tert` WHERE fact=1978 how to write an sql statement when i try to open CString sQLW = ("SELECT................ what? CDatabase_ALS pRo; pRo.Open(CDatabase_ALS::snapshot,sQLW); this statement it came from this CString sX = pRo.GetSQL(); m_lop.SetWindowText(sX); and this i have seen my select statement because i dont write it! all i want is to edit a field from cont ! ???????????????????????????????????????????????????????

          Bravoone

          V Offline
          V Offline
          vc _fragrance
          wrote on last edited by
          #4

          Is this link helpful http://www.codeguru.com/forum/showthread.php?p=1459845#post1459845

          1 Reply Last reply
          0
          • H Hamid Taebi

            if you want to read some cols you can simply enter names of cols Select col1,col2,col3 from table1


            WhiteSky


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

            sQL =("SELECT cont,codfiscal,fact FROM 2006tert"); using this i have this rezult : Invalid descriptor index!!!!!!!!!!!!!!!!!!! what can i do? -- modified at 7:53 Thursday 4th January, 2007

            Bravoone

            H 1 Reply Last reply
            0
            • B Bravoone_2006

              sQL =("SELECT cont,codfiscal,fact FROM 2006tert"); using this i have this rezult : Invalid descriptor index!!!!!!!!!!!!!!!!!!! what can i do? -- modified at 7:53 Thursday 4th January, 2007

              Bravoone

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              See here[^]


              WhiteSky


              1 Reply Last reply
              0
              • B Bravoone_2006

                how to open a query with just 3 columns? .my database contains 40 i think more... and when i try to update i have this error: SQL: Statement too long, because this is my statement: SELECT `cont`,`den`,`tip`,`fel`,`listare`,`carte`,`formular`,`rand`,`inchid`,`sid0`,`sid1`,`sid2`,`sid3`,`sid4`,`sid5`,`sid6`,`sid7`,`sid8`,`sid9`,`sid10`,`sid11`,`sid12`,`sid13`,`sic0`,`sic1`,`sic2`,`sic3`,`sic4`,`sic5`,`sic6`,`sic7`,`sic8`,`sic9`,`sic10`,`sic11`,`sic12`,`sic13`,`rld1`,`rld2`,`rld3`,`rld4`,`rld5`,`rld6`,`rld7`,`rld8`,`rld9`,`rld10`,`rld11`,`rld12`,`rlc1`,`rlc2`,`rlc3`,`rlc4`,`rlc5`,`rlc6`,`rlc7`,`rlc8`,`rlc9`,`rlc10`,`rlc11`,`rlc12`,`rcd0`,`rcd1`,`rcd2`,`rcd3`,`rcd4`,`rcd5`,`rcd6`,`rcd7`,`rcd8`,`rcd9`,`rcd10`,`rcd11`,`rcd12`,`rcc0`,`rcc1`,`rcc2`,`rcc3`,`rcc4`,`rcc5`,`rcc6`,`rcc7`,`rcc8`,`rcc9`,`rcc10`,`rcc11`,`rcc12`,`obs`,`codfiscal`,`fact`,`data_fact`,`data_scad`,`mag`,`rata`,`marca`,`verificat`,`i0`,`i1`,`i2`,`i3`,`i4`,`i5`,`i6`,`i7`,`i8`,`i9`,`i10`,`i11`,`i12`,`sold_vechi`,`sold_nou`,`l`,`curs_ini`,`data_curs`,`moneda`,`cont_conv`,`val_conv`,`curs_ref`,`r1`,`r2`,`r3`,`r4`,`r5`,`r6`,`r7`,`r8`,`r9`,`r10`,`r11`,`r12`,`nr_rate_r`,`tva`,`inceput`,`terminat`,`curs_fin`,`s_v_ini`,`bi`,`v_tva` FROM `2006tert` WHERE fact=1978 how to write an sql statement when i try to open CString sQLW = ("SELECT................ what? CDatabase_ALS pRo; pRo.Open(CDatabase_ALS::snapshot,sQLW); this statement it came from this CString sX = pRo.GetSQL(); m_lop.SetWindowText(sX); and this i have seen my select statement because i dont write it! all i want is to edit a field from cont ! ???????????????????????????????????????????????????????

                Bravoone

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #7

                What is CDatabase_ALS derived from? CRecordset? If so then check the class. Is there a DoFieldExchange override? If so, is it exchanging more fields than the three you want? If so, then that's a problem :)

                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