Setting primary key error

R

Rover

I have a very large table. In a database by itself its about 340mb.
When I try to set the primary key it says "Changing field data types"
then gives me an error "Can't change field data types - Not enough disk
space or memory". It's not a disk space problem so it must be memory.

Any ideas on how to get around this? Can I write code to create the new
key and table in another database? This project is due Friday!! Any
short cuts would be appreciated!

TIA

Jim
 
D

david epsom dot com dot au

Create a new database. Import all the other tables. Create
a new table with the correct field types. Import all the data.
Recreate any relationships.

(david)
 
R

Rover

In looking at the help file for "keys" in Access 2K there is no mention
of field types for keys. I am actually using 4 fields of type long
integer, integer, text (length 12) and integer. What are the field
types it needs?
 
J

John Vinson

I have a very large table. In a database by itself its about 340mb.
When I try to set the primary key it says "Changing field data types"
then gives me an error "Can't change field data types - Not enough disk
space or memory". It's not a disk space problem so it must be memory.

Any ideas on how to get around this? Can I write code to create the new
key and table in another database? This project is due Friday!! Any
short cuts would be appreciated!

TIA

Jim

I'm not sure just what you're actually doing, Jim. Access can create a
Primary Key on any field type except for Memo or OLE - you don't have
to create a field or change any field types to define a primary key!
All you need to do is open the table in design view, and ctrl-click on
up to ten fields which jointly define a unique record. If you then
click the Key icon, Access will create a (pretty much invisible to you
or the user) Primary Key index on that field (or those fields).

If you're getting "Changing field data types" as a message, I must
suspect that you are doing something ELSE.


John W. Vinson[MVP]
 
R

Rover

I don't know for sure what the problem is but here was the solution...
I copied the table structure only. I then set the keys and indices the
way I wanted them. I then wrote an append query taking my non-keyed
table and appending it to the newly created Keyed table. Problem
Solved. I had 3 tables that were this large or larger and the error and
solution worked on all 3.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top