[Solved] Adding a primary key

Discuss the database features
Post Reply
digdug
Posts: 2
Joined: Sat May 06, 2017 1:16 am

[Solved] Adding a primary key

Post by digdug »

Hi Everyone,
I first created my database using dbase3+ back in 1988.
I switched to using access around 2000 or so.
Then my hard drive died.

I now have a new hard drive but no Microsoft office software.

Fortunately I do have a copy of my database in MDB format.

I was able to connect to it using Open Office, but the problem is that I can't insert records.

I tried setting up a new table in Base with all of the same columns plus a pkey. That seemed to work
but then I can't copy the data over to the new version.

Can someone suggest an easy way to create a version of my database with a primary key.
Somehow that column needs to be populated with the number for all 19,000 records.

Any suggestions welcome.

Thanks
Last edited by RoryOF on Sat May 06, 2017 7:46 pm, edited 2 times in total.
Reason: Added green tick [RoryOF, Moderator]
Open Office 4.1.3 Windows 10
UnklDonald418
Volunteer
Posts: 1548
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Adding a primary key

Post by UnklDonald418 »

Create a new Base database and drag the Access table onto the table icon on your new Base database.
You will get a Copy table dialog.
On page one you choose the name of the new table, and of course you probably want to copy Definition and data.
Page two is where the columns to be copied are chosen.
Page three allows data types and sizes can be adjusted. The dialog may not always choose the correct type for numerical data, so check that. It defaults VARCHAR fields to 50 characters, so if your original table has fields with longer strings then you will need to make adjustments to the field length,
Click on Create and you should get the dialog Should a primary key be created now? Answer Yes.
If all goes well the table will appear on your new database.
If it reports errors, the most likely problem is with the length of VARCHAR fields.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
digdug
Posts: 2
Joined: Sat May 06, 2017 1:16 am

Re: Adding a primary key - Solved

Post by digdug »

Thanks very much. I was able to insert records. Now to write my query!
Open Office 4.1.3 Windows 10
Post Reply