Results 1 to 4 of 4
  1. #1
    Lowet50 is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2015
    Posts
    2

    Cannot find Table or Constraint

    I am taking an online Database Management Systems class and one of our assignment this week was to Write the SQL code that will create the table structure for a table named EMP_1. If you GOOGLE the question you will find a lot of people have already posted the answer

    CREATE TABLE EMP_1(


    EMP_NUM CHAR(3) PRIMARY KEY,
    EMP_LNAME VARCHAR(15) NOT NULL,
    EMP_FNAME VARCHAR(15) NOT NULL,
    EMP_INITIAL CHAR(1),
    EMP_HIREDATE DATE,
    JOB_CODE CHAR(3),
    FOREIGN KEY (JOB_CODE) REFERENCES JOB);

    The issue I am having is this: every time I enter this into a Query I receive the error "cannot find table or constraint" My teacher says that this should work but she has no experience using MS Access 2013. The only way we have been able to get this to work so far is to remove the FOREIGN KEY (JOB_CODE) REFERENCES JOB); statement.

    Can anyone think of any reason why this is not working?

  2. #2
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Either you don't have the Primary Key set properly on the JOB Table or the JOB Table doesn't exist.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Lowet50,
    Regarding Rawb's post - do you have a table JOB?
    If so, has this been resolved?
    If not, can you show us the structure of the Job table?

  4. #4
    Lowet50 is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2015
    Posts
    2
    That makes since, we were not given a JOB Table, there is an EMPLOYEE table that we can reference but it is not part of the database.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Using Constraint statement in SQL
    By shani20 in forum Programming
    Replies: 3
    Last Post: 01-27-2015, 09:48 PM
  2. Replies: 5
    Last Post: 09-29-2014, 07:43 PM
  3. Access SQL Syntax For Creating a Table With a Default Constraint
    By crystalclear in forum Database Design
    Replies: 3
    Last Post: 09-22-2013, 02:24 AM
  4. Referential integrity constraint
    By dsaxena15 in forum Access
    Replies: 3
    Last Post: 09-27-2012, 02:07 PM
  5. How do I display SQL constraint errors?
    By isabelle2378 in forum Forms
    Replies: 3
    Last Post: 10-19-2010, 03:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums