Results 1 to 11 of 11

Thread: Are recordes really deleted?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    shiraz
    Posts
    163

    Question Are recordes really deleted?

    Hi guys
    Well I have a mdb Database with size of 5 mb’s there was a table in it which had taken a lot of space but when I delete it through code or through visdata or access by such SQL statement:

    Delete * From Table1

    All fields of the table seems to be deleted but when I check the size of the mdb file, it is exactly the same size of the file before the fields of that large table was deleted. Does anyone know what the reason is? Do the data just become invisible? But it is somewhere in the file for future restoring? And how can I remove the data completely from the database?
    Thank u

  2. #2
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    you need to compact the db. You can do that manually, or through code. Look up "compact" in Access's on-line help.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    shiraz
    Posts
    163
    Originally posted by phinds
    you need to compact the db. You can do that manually, or through code. Look up "compact" in Access's on-line help.
    I’m using DBngine.CampactDatabase method to compact the db but one problem:
    It compacts the database in a second db but I want to compact the db just where it is. Because the database must be always opened.
    Is there some other way to compact the db (of course compact it in itself)?

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    no because the database must be closed to be compacted. Its a matter of file sharing violation like anything else.

    Besides there is no reason to need the database to be open while being compacted.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    shiraz
    Posts
    163
    Originally posted by Cander
    no because the database must be closed to be compacted. Its a matter of file sharing violation like anything else.

    Besides there is no reason to need the database to be open while being compacted.
    I can't close the db coz some other app is using it too. and that application opens the db as exclusive and this app must always be running. so once i want to run my own app i must close the second app.
    open the db in my own app
    then open the second app

    and i can do this only once coz the app must always be running
    that's why i wanted to compact the db without closing it

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    AFAIK it can't be done. The DB MUST BE CLOSED to prevent corruption during the compacting. If it's a problem, wait until after hours when no one is using the DB.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385
    mrdj1002,

    As all others that told you it can not be done. You need to believe it.

    One must learn that one can not change the laws of physics just because they are inconvienent!!

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Originally posted by randem
    One must learn that one can not change the laws of physics just because they are inconvienent!!
    No, but you should be able to subclass it, then use a Callback Method to redefine its behavior.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    shiraz
    Posts
    163
    Originally posted by techgnome
    No, but you should be able to subclass it, then use a Callback Method to redefine its behavior.
    hey guuuys why r u hitting me
    I just asked if there was any other solution. and i guess ur right i have to wait for some chance to close the db and compact it.
    thank u anyway

  10. #10
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    Access database over a network?
    Please rate my post.

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    shiraz
    Posts
    163
    Originally posted by Shawn N
    Access database over a network?
    no it's not a network.... the case is that 2 apps are sharing one db. my app is the second app which enhances the first app capibilitis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width