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. recordset question

recordset question

Scheduled Pinned Locked Moved C / C++ / MFC
question
10 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.
  • J Offline
    J Offline
    jafrazee
    wrote on last edited by
    #1

    is there a way to pack or zap a recordset? or do i have to create an outside program?

    A N D T 4 Replies Last reply
    0
    • J jafrazee

      is there a way to pack or zap a recordset? or do i have to create an outside program?

      A Offline
      A Offline
      Alexandru Savescu
      wrote on last edited by
      #2

      What do you mean by recordset? Do you mean database recordset? :confused: Best regards, Alexandru Savescu P.S. Interested in art? Visit this!

      J 1 Reply Last reply
      0
      • J jafrazee

        is there a way to pack or zap a recordset? or do i have to create an outside program?

        N Offline
        N Offline
        Nick Parker
        wrote on last edited by
        #3

        You could possibly serialize the recordset object, if this is what you mean, I am not sure. -Nick Parker

        J 1 Reply Last reply
        0
        • A Alexandru Savescu

          What do you mean by recordset? Do you mean database recordset? :confused: Best regards, Alexandru Savescu P.S. Interested in art? Visit this!

          J Offline
          J Offline
          jafrazee
          wrote on last edited by
          #4

          yes, i am sorry i am most likely using the wrong wording for vc++. pack and zap are database terms. pack will permently delete all records marked for deletion. zap removes all records from the table. are there any mfc functions that do the same.

          1 Reply Last reply
          0
          • N Nick Parker

            You could possibly serialize the recordset object, if this is what you mean, I am not sure. -Nick Parker

            J Offline
            J Offline
            jafrazee
            wrote on last edited by
            #5

            you know that may be what i want to do, but i can not find any documentation on it. what does that function actually do? and what does it required to be passed? thanks

            1 Reply Last reply
            0
            • J jafrazee

              is there a way to pack or zap a recordset? or do i have to create an outside program?

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

              Is this a SQL database? If so, it has built-in stored procedures for just this sort of thing, and more.

              J 1 Reply Last reply
              0
              • D David Crow

                Is this a SQL database? If so, it has built-in stored procedures for just this sort of thing, and more.

                J Offline
                J Offline
                jafrazee
                wrote on last edited by
                #7

                it is a access database being accessed through odbc.

                D 1 Reply Last reply
                0
                • J jafrazee

                  it is a access database being accessed through odbc.

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

                  I'm not as experienced with Access, but I do not know of it having anything internally that will pack a database. If that is indeed the case, you will need to do it manually. Something like: open database in exclusive mode create a temporary database for each row that is not marked for deletion, copy it to temporary database close the temporary database close the main database delete the main database rename the temporary database This is a very high-level overview but hopefully you get the idea. You might also want to look at the Compact utility. It works in basically the same way I described above, but no doubt more elegantly!

                  J 1 Reply Last reply
                  0
                  • D David Crow

                    I'm not as experienced with Access, but I do not know of it having anything internally that will pack a database. If that is indeed the case, you will need to do it manually. Something like: open database in exclusive mode create a temporary database for each row that is not marked for deletion, copy it to temporary database close the temporary database close the main database delete the main database rename the temporary database This is a very high-level overview but hopefully you get the idea. You might also want to look at the Compact utility. It works in basically the same way I described above, but no doubt more elegantly!

                    J Offline
                    J Offline
                    jafrazee
                    wrote on last edited by
                    #9

                    that is what i was originally thinking. but that again is what i was hoping to avoid. when you get to large files this function becomes slow. thank you.

                    1 Reply Last reply
                    0
                    • J jafrazee

                      is there a way to pack or zap a recordset? or do i have to create an outside program?

                      T Offline
                      T Offline
                      Toni78
                      wrote on last edited by
                      #10

                      First of all I am not sure what you mean by marked for deletion? Is there a field in the table that marks the recordset for deletion? If not, then you should check the batch mode. If there is a field in the table that flags the record as deleted then you should check SetFilter or set_filter functions. This way only the records that need to be deleted will be accessed (you can specify your own filter criterias). If your database allows you to delete multiple records at once then you can go ahead and do that. If not, then you should iterate through each element and delete them. How are you accessing the database? ODBC, ADO, etc.? // Afterall, I realized that even my comment lines have bugs When one cannot invent, one must at least improve (in bed).-My latest fortune cookie

                      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