Results 1 to 4 of 4

Thread: Delete an open .mdb file

  1. #1
    Lively Member
    Join Date
    Aug 09
    Posts
    98

    Delete an open .mdb file

    In vb6 I am using Microsoft.Jet.OLEDB.4.0 to open an existing .mdb file. Before opening it I want to Kill (delete) it so that new data is inserted in it.
    When first time it is opened, Kill statement deletes the file and new data appears in Report but when next time Kill is used, it doesn't delete the file (as .ldb file is made this time).
    Please help me delete this .mdb file in this case.

    Thanks

  2. #2
    PowerPoster
    Join Date
    Jul 06
    Location
    Maldon, Essex. UK
    Posts
    5,387

    Re: Delete an open .mdb file

    It's fairly unusual to delete the entire Database. Are you sure that's what you want to do. I can understand wanting to DROP a Table (ie Remove it completely) and DELETE FROM a Table (removing all rows from a Table)

  3. #3
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 04
    Location
    Staffordshire, England
    Posts
    2,092

    Re: Delete an open .mdb file

    Before you can Kill this database you have to close the connection the .ldb means its being used.
    Keith

    I've been programming with VB for 17 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.


  4. #4
    PowerPoster
    Join Date
    Feb 12
    Location
    West Virginia
    Posts
    4,978

    Re: Delete an open .mdb file

    That is a very odd request. You can not delete a file that is open and you can not open a database that does not exist.

    You can delete the data from the table as mentioned by Doogle which will remove all the data from the table.

Posting Permissions

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