?
Solved

how can i add one field to my table?

Posted on 2003-02-19
6
Medium Priority
?
198 Views
Last Modified: 2010-04-17
I am using ADO to manipulate my table. i have an input table, then i will output several different tables, for the output table, how can i add an auto-increased ID field into my table? THANK YOU VERY MUCH FOR YOUR SUGGESTION :)
0
Comment
Question by:belinda_sg
[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
6 Comments
 
LVL 4

Expert Comment

by:bistrica
ID: 7985896
in table design set property of column to autonumber
0
 

Expert Comment

by:dev_tek
ID: 7986002
Its simple just make that column as autonumber and when u insert record use UPDATE query with out inserting any value for that column.
0
 
LVL 16

Expert Comment

by:twalgrave
ID: 7987654
Please specify further your requirements.
1) What database
2) Are you using ADO to actually create the table, or to return the data from an already-defined table
3) What are the restrictions on the auto-increased ID field (is it OK to have gaps in the numbers?)
0
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!

 

Author Comment

by:belinda_sg
ID: 7991297
i use microsoft access to sort my database.
in fact, i am not going to create a table, i am using SQL to select certain records to my new table. so in one form, i use Microsoft Hierarchical FlexGrid Control to show one table, in the new form, i also use the same format, but i wanna add a new field named "S/N" so that i can know that how many records i have for the new table. thank you for you all's help...
0
 
LVL 16

Accepted Solution

by:
twalgrave earned 120 total points
ID: 8000223
So you will be doing something like:
Insert into Table2 (select "1" as NewIDCol, col2, col3,col4,col5 from Table1)

Then you can go through and change each column's information after you insert the information in the new database table.
0
 
LVL 3

Expert Comment

by:FaithRaven
ID: 9307705
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept twalgrave's comment
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

FaithRaven
EE Cleanup Volunteer
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Starting up a Project

800 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