Create a new table into Database by using VB coding


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Create a new table into Database by using VB coding

  1. #1
    Sara Yen Guest

    Create a new table into Database by using VB coding


    I wonder how to create a new table into SQL Database by using VB coding?
    I know how to use recordset to access the data from an exist table.
    But now, I want create a new table into Database, but how???
    Thanks for help!!

    Sincerely,

    Sara Yen

  2. #2
    D. Patrick Hoerter Guest

    Re: Create a new table into Database by using VB coding

    Sara,

    You just have to use DDL (Data Definition Language) commands.

    CREATE TABLE is the one you want.

    i.e. for SQL Server

    CREATE TABLE
    myTable
    (
    Column1 int,
    Column2 ,
    Column3 varchar(30
    )

    Just use your database connection's Execute method to execute the
    string.

    Regards,
    D. Patrick Hoerter

    Sara Yen wrote in message <393bea57$1@news.devx.com>...
    >
    >I wonder how to create a new table into SQL Database by using VB coding?
    >I know how to use recordset to access the data from an exist table.
    >But now, I want create a new table into Database, but how???
    >Thanks for help!!
    >
    >Sincerely,
    >
    >Sara Yen



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center