Share via

Problem with Access giving me syntax error on correct code

Anonymous
2024-10-10T19:22:44+00:00

Code I'm using:

CREATE TABLE SKILL (

SKILL_ID AUTOINCREMENT NOT NULL,

SKILL_DESCR VARCHAR(255) NOT NULL,

SKILL_RATE_PAY NUMERIC(9,2) NOT NULL );

This code will not work and gives a syntax error.

I installed on a different pc and this code works on a new database, (database1). However, when I create a new database (database2) and paste this same code into it, it gives me a syntax error.

When I go back to database1 the code works again and creates the table.

I have no idea what is going on or how to fix it.

Microsoft 365 and Office | Access | For education | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2024-10-11T12:24:45+00:00

Check the settings for the SQL Server Compatible Syntax property in the Object Designers tab of the Options dialogue in Access on each machine.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

8 additional answers

Sort by: Most helpful
  1. George Hepworth 22,855 Reputation points Volunteer Moderator
    2024-10-10T20:34:25+00:00

    NUMERIC(9,2) ?

    I know that is a SQL Server datatype, but I'm not aware of it in Access. So, I guess I should have asked if you are trying to create this as an Access table? Using DAO?

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,810 Reputation points Volunteer Moderator
    2024-10-10T20:26:30+00:00

    I am new to Access and do not know what you mean by what references are set.

    Press Ctrl+g to enter the VBE. Then go to Tools>References to see what References are being used

    Is there a reason you are using DDL SQL statements to create tables instead of Table Design mode?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-10-10T19:37:07+00:00

    On my laptop it states 'property not found'

    On my desktop, the second installation, it says 'syntax error' and highlights the first parenthesis in (9,2)

    I am new to Access and do not know what you mean by what references are set.

    Was this answer helpful?

    0 comments No comments
  4. George Hepworth 22,855 Reputation points Volunteer Moderator
    2024-10-10T19:28:42+00:00

    What, specifically, is that syntax error?

    What references are set in the two different accdb files?

    Was this answer helpful?

    0 comments No comments