Solved

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

Posted on 2006-11-30
7
1,173 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
VB.net Duplicating a table - primary key not created 3 41
vb.net deleting excel sheet in workbook 11 52
vb.net dbnull syntax 1 48
Adding Rows to Grid 4 26
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 …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

738 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