473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Importing primary key numbers from an old database

I am converting an old DOS database to Access 2010. The old database has a primary key which is a five digit number. When I imported this into a new table from an Excel sheet, I am not able to use these numbers as a primary key. How can I do this? And then, once I can (if I can) how can I now be sure that the numbers will continue to be sequential from the last five digit number in the new primary key? Also, let's say that the last primary number is 15001 and for some reason I want to make the next new number start at 15101, how can I do this?
Jun 22 '10 #1
4 1869
jimatqsi
1,271 Expert 1GB
Are you saying the keys cannot change? Is it enough that they be unique, or must they also remain with the same value they already have?

Jim
Jun 23 '10 #2
These numbers are the "client numbers" that we have been using for years. To have to change them would be a problem. Thus I would like to know how to subsequently sequence them using them as the primary numbers. Also,due to some particular quirk in the way we used to enter new clients into our database (using DataEaste for DOS) we were always able to change the next starting number and just say sequence from #####. Is this possible in Access 2010? Thanks.
Jun 24 '10 #3
I figured it out. After importing all the old data from the old database, create a worksheet in Excel,and make the column heading the same name as the primary key in the database you want to update. Then enter the next number you want to use in the Excel worksheet, save the worksheet, then run a import data from Excel as an append records to a copy of the table and you are set. At least this works so far in testing.
Jul 2 '10 #4
NeoPa
32,556 Expert Mod 16PB
If your requirement is to have specific numbers in this field then using an AutoNumber key is definitely not a good idea. PKs do not need to be assigned automatically. You should be using a form to control data entry (whether via the form or even if by importing a new batch of data). You can have a TextBox control on your form that you can use to ensure new numbers are created starting from a particular point. Otherwise, the next number can easily be worked out by using a simple DLookup() call on the table.
Jul 2 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Oliver Spiesshofer | last post by:
Hi, I have a MySQL .sql file that contains not only a single table but several, its a dump from a complete database. How can I import that back into a MySQL Server? MySQLImport seems not to be...
2
by: Harry | last post by:
Hello, I have the contents of a MySQL database sitting in a folder. Each file in the folder is an ISAM table that is comprised of three files, its ..frm, .MYI and .MYD. I would like to import this...
2
by: Justin Allen | last post by:
SQL 2000, Windows 2000. I need to find a way to export our data from our production database and import it into a test database. I can do it to a freshly created test database I just have trouble...
5
by: kai | last post by:
Hi, All I try to block some one import my Access database tables using Access database. I used password protection, but if some one crack through my password, are there any other methods to...
1
by: cheungs7 | last post by:
Hi all, Wondering whether you can anyone help me. We have Sage Payroll (and accounting/payroll software), which has a MS Access database where the data is stored. Now I want to access the...
0
by: siachen00 | last post by:
i have to import data(in a csv file) into database.The data is converted to a XML file .Then transformed to another XML file , the resolution of keys takes place and then loaded into databse. In...
3
by: Sam Alexander | last post by:
Hi Everone, I'm writing a script to import data from an XML file, and this tutorial is really an awesome guide : http://www.kbalertz.com/Q316005/Import.Server.Component.aspx ... problem though...
4
by: Goofy | last post by:
The add database ( MDF ) in Visual Studio 2005 seems to be in SQL Server 2005 format as far as I can tell. Does anyone know how I can import tables ( without having to start writing queries ) from...
1
by: gollumullog | last post by:
Good Day, I have been having this issue for quite a long time, and have yet to find an easy/elegant solution. I am trying to create tables in an Access database. I have these tables as CSV...
2
by: idioteque | last post by:
Hi everyone, I don't have a lot of experience in database management, but I'm trying to replicate a database that is currently being used on a live website. I'd like to replicate it so that our...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.