Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005

    Question Unanswered: Constraint management via SQL


    I'm currently working a content management system in C#, that will among other databases support MS Access. Currently I'm working on a patcher that will allow to change the database structure at all the customers. However, when it comes to MS Access I'm having real problems in managing the constraints via SQL.

    My first problem is that I cannot seem to be able to remove a NOT NULL constraint dynamically via SQL. I've tried ALTERing the columns and describing them with NULL or nothing at all, but yet the NOT NULL remains.

    My other problems is with extracting the current constraints dynamically. The only constraints I can find are the foreign keys in the system tables. I am in need of finding the primary key constraints, the unique constraints, their names and the columns and tables they affect.

    Any Access expert who could help me?


  2. #2
    Join Date
    Jan 2005
    I'm pretty sure JET doesn't support that.

    You can add NOT NULL via ALTER TABLE, but I don't *think* it can go the other way.

    If you need to do that, it'll have to be via VBA DAO, or by hand via the GUI.

    Either that, or use C# to manipulate DAO.

Posting Permissions

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