Results 1 to 3 of 3

Thread: [RESOLVED] Delete tables from database programatically

  1. #1

    Thread Starter
    Lively Member mindloop's Avatar
    Join Date
    Mar 2004
    Posts
    64

    [RESOLVED] Delete tables from database programatically

    hy there ,
    i have a database with numerous tables and i need to make a copy of it, then delete the tables i don't need, leaving only one table in the copied file.
    is this possible ? modifying the .mdb structure through vb.net?
    i need this so that i can export data from one table only in a single file, and the other tables are just taking up space (the whole database has 6 mb when it is empty and is not very portable.)
    i could store a database containing only my desired table with the program files for this purpose only, but i was wondering if there is another way as i don't like this solution.
    any ideeas ?
    Last edited by mindloop; Apr 27th, 2004 at 03:30 PM.
    ehmm...

  2. #2
    Addicted Member
    Join Date
    Jul 2000
    Location
    didn't decide yet
    Posts
    222
    VB Code:
    1. cnNew.Open()
    2.         cmd = New OleDbCommand("DROP Table TABLE_NAME", cnNew)
    3.         Try
    4.             cmd.ExecuteNonQuery()
    5.         Catch ex As Exception
    6.             MsgBox(ex.Message)
    7.         End Try
    Come and get our ISDN CallerID http://www.3wm.biz

  3. #3

    Thread Starter
    Lively Member mindloop's Avatar
    Join Date
    Mar 2004
    Posts
    64
    thanks i guess that will do, didn't expect it to be as simple.
    ehmm...

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