Create tabledefinitions and drop tables by code

  • Follow


Hi, can anyone help me with the correct statements
to copy a table(design), so a new table with just the skeleton of an 
existing table,
and also how to drop an existing table ?

I need this code for use in a VB.NET 2005 program...

Thanks

-- 
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
-------------------------------------------------

    Earlier request in the dotnet newsgroup :

    Do some searches in the comp.databases.ms-access newsgroup for "create
    tables." After you have some sample code just add a reference to access
    and .Net and you should be set.

    Thanks,

    Seth Rowe


         Screaming Eagles 101 wrote:
        > Hi,
        >
        > I have an Access MDB database with a Table1.
        > From VBNET I would like to CREATE a NEW table, which is a copy of 
Table1,
        > but not with the Data, only the definition.
        > I would also like to have the possibility to DROP a table in that 
Database.


0
Reply see_my_site (2) 10/18/2006 10:05:24 AM

You can drop a table easily by executing the SQL statement "DROP Table 
YourTableName".

You can create a table using the SQL command "CREATE TABLE", but JET SQL 
doesn't provide a means of creating a new table based on the schema of an 
existing table. In VBA or VB 'classic' we would use DAO or ADOX to do 
something like that. These are COM components, and you could use them from a 
VB.NET app via COM Interop, but I am not at all convinced that this would be 
the right way to go in a .NET app. My advise is to try asking again in 
another .NET forum. Try microsoft.public.dotnet.framework.adonet.

-- 
Brendan Reynolds
Access MVP

" Screaming Eagles 101" <see_my_site@online.please> wrote in message 
news:25-dnSxXT_z4YajYRVnyjg@scarlet.biz...
> Hi, can anyone help me with the correct statements
> to copy a table(design), so a new table with just the skeleton of an 
> existing table,
> and also how to drop an existing table ?
>
> I need this code for use in a VB.NET 2005 program...
>
> Thanks
>
> -- 
> Filip
> http://www.ww2airborne.net/
> Official Site of the 101st Airborne - 463rd PFA
> skype: airborne463pfa-fiwi
> -------------------------------------------------
>
>    Earlier request in the dotnet newsgroup :
>
>    Do some searches in the comp.databases.ms-access newsgroup for "create
>    tables." After you have some sample code just add a reference to access
>    and .Net and you should be set.
>
>    Thanks,
>
>    Seth Rowe
>
>
>         Screaming Eagles 101 wrote:
>        > Hi,
>        >
>        > I have an Access MDB database with a Table1.
>        > From VBNET I would like to CREATE a NEW table, which is a copy of 
> Table1,
>        > but not with the Data, only the definition.
>        > I would also like to have the possibility to DROP a table in that 
> Database.
>
> 


0
Reply Brendan 10/18/2006 10:30:55 AM


1 Replies
114 Views

(page loaded in 0.058 seconds)

Similiar Articles:













7/29/2012 4:16:19 AM


Reply: