I use for my project a blank table named SERVIZIO with 7 fields. (is a service table)
Is possible to recopy into the same database, via ADO or other drive+vba for excel, and rename the table SERVIZIO and maintain the old table SERVIZIO for future use?
rename table in access database...
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: rename table in access database...
You could execute a SQL string
SELECT * INTO NewTable FROM SERVIZIO
This will create a table NewTable and copy the records from SERVIZIO into it.
SELECT * INTO NewTable FROM SERVIZIO
This will create a table NewTable and copy the records from SERVIZIO into it.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: rename table in access database...
tKS Hans but the SERVIZIO not have any data...HansV wrote:You could execute a SQL string
SELECT * INTO NewTable FROM SERVIZIO
This will create a table NewTable and copy the records from SERVIZIO into it.
I need only to recopy the table SERVZIO and rename in NewTable.
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: rename table in access database...
If SERVIZIO doesn't have any records, executing the SQL string will create an empty table NewTable with the same fields as SERVIZIO.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: rename table in access database...
ok tks.HansV wrote:If SERVIZIO doesn't have any records, executing the SQL string will create an empty table NewTable with the same fields as SERVIZIO.
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: rename table in access database...
OK,HansV wrote:If SERVIZIO doesn't have any records, executing the SQL string will create an empty table NewTable with the same fields as SERVIZIO.
during the exceute of sql i have the database opened...
i dont see into the database the new table created... to see tath i nedd to close and reopen the database. 2 little question:
-Existis a refresh metod to see in real time the new table created? (similar the F5 in Access menu)
-I can use, in other case, the new table if i dont see?
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: rename table in access database...
If you have Access open, you only need to select View | Refresh or press F5 to see the new table. No need to close and reopen the database.
Even if you don't see it yet, it exists, so you can work with it in queries etc.
Even if you don't see it yet, it exists, so you can work with it in queries etc.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: rename table in access database...
Good!HansV wrote:If you have Access open, you only need to select View | Refresh or press F5 to see the new table. No need to close and reopen the database.
Even if you don't see it yet, it exists, so you can work with it in queries etc.