VB2005 : Create table in Access - copy of another table but without the data

  • Thread starter Thread starter Screaming Eagles 101
  • Start date Start date
S

Screaming Eagles 101

Hi,
I'dd like to create a table in an Access MDB, which is a copy of an existing
table,
but without the data, only the structure.
--
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
-------------------------------------------------

Someone in the newsgroup comp.database.ms-access suggested I should ask it
here :

(((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,

You could use a Select Into statement to create the table structure without
data, but you would still need to add primary key, etc., using Alter
statements.

If you can't create the table using SQL then ADOX is your best bet.

Kerry Moorman
 
Maybe in a transaction?

start TA
Copy one or more (all records)
Delete from target
Commit.
 
Back
Top