Results 1 to 2 of 2

Thread: Deleting a table from database

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    15

    Question Deleting a table from database

    Hei dude, can u teach me how to delete a particular table from a database by stating the database name in use ans the table name to be delete. then just push the command button to execute the delete statement. so how to write the delete statement??

    thanks


  2. #2
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621

    Talking

    This should do it

    Code:
    Dim dbs As Database
    
    	' Modify this line to include the path to your database
    	Set dbs = OpenDatabase("MyDB.mdb")
    
    	' Delete the table.
    	dbs.Execute "DROP tblMyTable;"
    
    	dbs.Close
    Hope this helps
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


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