Solved

Renaming a table

Posted on 2000-03-20
5
211 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
Comment Utility
do you mean permanently?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
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
Comment Utility
Adjusted points from 15 to 30
0
 

Author Comment

by:lirong
Comment Utility
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
Comment Utility
If you are inside an Access Module,
then do the following code:
Application.CurrentDb.TableDefs("Table1").Name = "Table2"

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now