Results 1 to 4 of 4

Thread: Delete Multiple Table

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Singapore
    Posts
    43

    Post

    Hi guys is there a way to delete multiple table in a single command or any other sugestion?? THKS.

    The code for delete one table is as follow:

    Dim db As Database
    Dim sql As String

    Set db = OpenDatabase("c:\p1\data.mdb")
    sql = "delete from ACC"
    db.Execute sql

    Is there another way whereby i could add in a single command line into to above to delete
    another table??

    e.g:
    Dim db As Database
    Dim sql As String

    Set db = OpenDatabase("c:\p1\data.mdb")
    sql = "delete from ACC"
    sql = "delete from eACC"
    db.Execute sql

  2. #2
    New Member
    Join Date
    Jul 1999
    Posts
    7

    Post

    Action Query:

    Dim db As Database

    Set db = Workspaces(0).OpenDatabase("c:\Wherever\Wherever\Database.mdb")

    db.Execute "DELETE * FROM Table1"
    db.Execute "DELETE * FROM Table2"

    db.Close

    Set db = Nothing


    Hope this helps...........


    --Steph


    ------------------
    Email: [email protected]
    "Face Down In The Warm Cabo Sand"


    [This message has been edited by Off2Cabo (edited 10-08-1999).]

  3. #3
    Member
    Join Date
    Apr 1999
    Location
    Kirkland, WA, USA
    Posts
    40

    Post

    If you've set relationships with cascading deletes and the second table's records match the relationship properties then the seond tables's realted records could "automatically" be deleted.

    If not each table gets it's own DELETE query.

    ------------------
    http://www.smithvoice.com/vbfun.htm

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Singapore
    Posts
    43

    Post

    Thks guys. It works.

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