locked
Adding a column of type AutoNumber RRS feed

  • Question

  • Hi.
    I am writing a program that connects to an Access database. The table can have any number of rows. In my example I have about 172,000 rows. Now I am trying to use the following DDL statement to add a column of type AutoNumber to this table.

    alter table <Table_Name> add column <Column_Name> COUNTER NOT NULL

    But I get the following error:

    [Microsoft][ODBC Microsoft Access Driver] File sharing lock count exceeded. Increase MaxLocksPerFile registry entry.

    Now, one way to fix this is to modify the registry entry to the value '172,000' for the database driver as mentioned in the error message. But the users of my program can have any number of rows in their table. So, is there a way to (preferably using DDL) to have this statement executed on the table without having to modify the registry entry?

    Thanks.

    Shakeel.

    :)
    Saturday, July 22, 2006 8:01 AM

All replies

  • One possible error can if you are table is not empty you can add a NOT NULL column....maybe add a NULL columen and populate it later....
    Monday, July 24, 2006 2:42 PM