Results 1 to 2 of 2

Thread: ALTER statement

  1. #1
    Join Date
    Nov 2002
    Posts
    2

    Unanswered: ALTER statement

    I am trying to add a two-field primary key to a table in code (i'm trying to use a Data Definition query, but could probably also do it through VBA, though that is just a little extra work).

    To begin, I am trying just to add a one-field primary key

    ALTER TABLE <table>
    ALTER COLUMN <onefield> TEXT
    CONSTRAINT PK_<table> PRIMARY KEY


    When it runs I get this error:

    File Sharing Lock Count Exceeded.

    I know that I could edit the registry to allow more locks, but why can I add a primary key through the Access UI without problem but not with code? Is there a problem with my ALTER TABLE statement? And how would I add a second field.

    Thanks a lot,

    Squeaky

  2. #2
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Have a look at the Microsoft Knowledge base article.

    http://support.microsoft.com/default...b;en-us;115833


    David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •