Adding Primary Key Field To Exist Database

Jonny

Registered User.
Local time
Tomorrow, 00:05
Joined
Aug 12, 2005
Messages
144
I have a database with 200.000 records, how I Add Primary Key Field.
I'm getting error "File sharing count exceeded..", tried to increase "MaxLocksPerFile" registry , but without success.
 
if you want to add an additonal field as the primary key i would create a duplicate empty table with the additonal field and then import the original data into the new table. if you use autonumber as your primary key it will automatically increment the primary key for you.

Ant
 
You can increase MaxLocksPerFile with this:

Application.DBEngine.SetOption dbMaxLocksPerFile, <NumLocks>

However, this sounds more like you're trying to alter a table while the DB is opened in shared mode instead of exclusive mode.
 

Users who are viewing this thread

Back
Top Bottom