Solved

NEEDED ACCESS     Statment like    ALTER TABLE ttt RENAME COLUMN aaa TO bbb

Posted on 2006-11-30
7
1,155 Views
Last Modified: 2008-02-01
A very important task

I Need  to rename an access database field from VB dot net 2005

I forgot all about using DAO
if possible SQL statement
like


ALTER TABLE ttt RENAME COLUMN aaa TO bbb
that works in SQL

0
Comment
Question by:Bahnass
7 Comments
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18047241
I don't remember Access-specific DDL queries too well, but I'd guess it's:

ALTER TABLE ttt CHANGE COLUMN aaa bbb INT NOT NULL;
0
 
LVL 3

Author Comment

by:Bahnass
ID: 18047367
thx dear but

CHANGE is not a reserved word in ACCESS SQL

0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 18047404
you need to add a reference to the ADO Extensions for Security and Data Definition (ADOX)

then you can use the ADOX.Catalog and ADOX.Table objects

AW

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Author Comment

by:Bahnass
ID: 18047509
Don't know how to do for vb 2005
0
 
LVL 3

Author Comment

by:Bahnass
ID: 18047872
Sorry I repated it
on
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_22078122.html
and had the answer

I believe the only way you can accomplish this is by:

1)  Adding a column:

ALTER TABLE yourTableName ADD COLUMN NewName datatype(size)

2)  Run an update statement to copy the data from the old column to the new one:

UPDATE yourTableName SET NewName = OldName

3)  Then drop the old column:

ALTER TABLE yourTableName DROP COLUMN OldName
0
 
LVL 5

Accepted Solution

by:
maralans earned 500 total points
ID: 18047910
You should probably make a request to have this question deleted and have the points refunded.
0
 
LVL 3

Author Comment

by:Bahnass
ID: 18055589
Dear maralans
Just wanted to say thank U with these 500 point
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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