Solved

Renaming a table

Posted on 2000-03-20
5
229 Views
Last Modified: 2010-05-18
Hello

Is there a possibility to rename a table, using the DAO objects ?

Or, is there another possibility ?

Waiting for your answer soon,

Thanks,

Golan Liron
0
Comment
Question by:lirong
  • 2
  • 2
5 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2635393
do you mean permanently?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2635533
What database are you speaking of?
If you have SQL Server, yes.
You execute the stored procedure using the DAO Connection object
EXEC sp_rename 'oldname', 'newname'
0
 

Author Comment

by:lirong
ID: 2635743
Adjusted points from 15 to 30
0
 

Author Comment

by:lirong
ID: 2635744
I don't understand.

I'm working with Access, and using the recordset, database and workspace objects.
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 30 total points
ID: 2635760
If you are inside an Access Module,
then do the following code:
Application.CurrentDb.TableDefs("Table1").Name = "Table2"

0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question