Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    Plymouth, UK
    Posts
    59

    Unanswered: Vb Code To Delete A Table?

    I have a table that needs to be deleted in 6 months time, I currently manually do this but can it be automated if I enter the date which it needs to be deleted??

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Davekingwcp
    I have a table that needs to be deleted in 6 months time, I currently manually do this but can it be automated if I enter the date which it needs to be deleted??
    How do you want to delete it? ADO? DAO?

    SQLString="DROP TABLE SmoeTable;"
    DoCmd.RunSQL SQLString

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    In addition to M Owen's suggestion you can say

    If DeletionDate >= date()+ 6*30
    Docmd.RunSQL("Drop Table yourTableName;")
    endif

    Where DeletionDateis the date, when you want to delete your 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
  •