Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Renaming a table

Posted on 2000-03-20
5
Medium Priority
?
264 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 143

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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 120 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Suggested Courses

963 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