Solved

alter more than one field at once access 2007

Posted on 2011-02-21
6
323 Views
Last Modified: 2012-06-27
Hi,
how can i alter more than one field in access 2007
 i need to change a fields in a table with number instead of text

example :
table1 , field1:TEXT filed2:TEXT
i need to alter table 1 changing field1 to NUMBER and field2 to NUMBER
0
Comment
Question by:drtopserv
6 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 34942178
Don't really see the issue here.
What is stopping you changing the datatype?
0
 
LVL 5

Accepted Solution

by:
jaiminpsoni earned 125 total points
ID: 34942261
You can not do it in a single statement, you need to run multiple statements...

http://msdn.microsoft.com/en-us/library/bb177883(v=office.12).aspx

ALTER TABLE <TableName> ALTER COLUMN <ColumnName> <Datatype>
0
 
LVL 77

Expert Comment

by:peter57r
ID: 34942293
I didn't see anything in the Q that says this must be done in code - is that what you meant drtopserv?
To me, it just looked like  case of opening the table in design view and doing the changes.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:drtopserv
ID: 34942301
in data definition in the query ... should i write >? :
ALTER TABLE <TableName1> ALTER COLUMN <ColumnName1> <Datatype>
ALTER TABLE <TableName2> ALTER COLUMN <ColumnName2> <Datatype>
ALTER TABLE <TableName3> ALTER COLUMN <ColumnName3> <Datatype>
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 125 total points
ID: 34942376
To expand a bit on what jaiminpsoni wrote:

You'd have to issue individaul commands for EACH DDL query. You can't lump them together the way you can with other databses:

CurrentProject.Connection.Execute "ALTER TABLE <TableName1> ALTER COLUMN <ColumnName1> <Datatype> "
CurrentProject.Connection.Execute "ALTER TABLE <TableName2> ALTER COLUMN <ColumnName2> <Datatype> "
CurrentProject.Connection.Execute  "ALTER TABLE <TableName3> ALTER COLUMN <ColumnName3> <Datatype> "
0
 
LVL 5

Expert Comment

by:jaiminpsoni
ID: 34942415
See if this helps....

http://www.ehow.com/how_13580_create-sql-query.html

Look at section....

Creating a Pass-Through Query and Creating a Data-Definition Query
http://www.ehow.com/how_13580_create-sql-query.html#ixzz1Eb76s3kR

See if that helps...
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Read about achieving the basic levels of HRIS security in the workplace.
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

821 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