문제

I'm getting a syntax error and am unable to save my database. The syntax error is supposedly in "CREATE TABLE" but "INSERT" is what gets highlighted.

 CREATE TABLE courses 
    (
    classid integer primary key, 
    name varchar (50), 
    coursenum char(4), 
    credhours integer
    );

 CREATE TABLE takes_courses
    (
    id integer references students(id),
    classid integer references courses (classid),
    semcode char(4)
    );

    INSERT INTO takes_courses
    (id, classid, semcode)
    VALUES
    (500, 1001, "FA14")

    INSERT INTO takes_courses
    (id, classid, semcode)
    VALUES
    (501, 1002, "FA14")

    INSERT INTO takes_courses
    (id, classid, semcode)
    VALUES
    (501, 1003, "SP15")

    INSERT INTO takes_courses
    (id, classid, semcode)
    VALUES
    (502, 1008, "FA15")
도움이 되었습니까?

해결책

You reported "The syntax error is supposedly in "CREATE TABLE" but "INSERT" is what gets highlighted."

That could happen if the INSERT and CREATE TABLE statements are both contained in the same Access query.

But Access will not let you combine multiple statements and execute them as a batch. So you must use a separate query for each statement and execute each separately.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top