Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004

    Unanswered: CONSTRAINT.........pls help

    hi i am just a beginner, dont know much abt sql statements, just learning... i am doing an assignment.. in the first one i have to create some tables and produce some statements to join, project, update, delete etc.

    My problem is i am doing in on Microsoft Access.. i cant find how to put constraint.. for eg,

    in this staements above how can i put constraint to allow to put date of birth wh is only 1920> AND 1985< etc, and the balance should be more thn or equal to 0 etc. its just how to put constraint in microsoft access. i should use constrain as much as possible. plssss any help wud be really appreciated.

    CREATE TABLE Customers

    customer_id INT NOT NULL ,
    last_name VARCHAR NOT NULL ,
    first_name CHAR(10) NOT NULL,
    date_of_birth DATE,
    employment TEXT,
    address VARCHAR(50) NOT NULL,
    account_type STRING,
    balance FLOAT,
    interest REAL,
    overdraft CURRENCY ,
    last_modified_date DATE,
    last_modified_time TIME,
    PRIMARY KEY (customer_id),
    UNIQUE (last_name, first_name, date_of_birth),

  2. #2
    Join Date
    Sep 2003
    The extremely Royal borough of Kensington, London
    A check constraint can only be specified for an MDB through ADO and with an OLE DB provider.

    With CurrentProject.Connection
      .Execute "Create table a (name number, check (name < 5))"
    End With
    Dim conn As new ADODB.Connection
    With conn
      .Provider = "Microsoft.Jet.OLEDB.4.0"
      .Execute "Create table a (name number, check (name < 5))"
    End With
    Last edited by r123456; 11-20-04 at 08:26.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Nov 2004
    thank you very much for your reply....but u know... may be it sound silly..but i still really dont know abt these u have mentioned should i download tht microsoft jet 4.....or sth........i am really confused....

Posting Permissions

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