Solved

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

Posted on 2006-11-30
7
1,178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

628 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