B
Brandon McCombs
Hello,
I have 2 questions. I'm new to Access and have a high level DB class
where the current project is simply to implement a db using Access. I'm
relatively familiar with SQL and so far haven't had any issues with the
actual queries. We have to create tables, populate them, and then run
queries against them. I've already run the queries and they run fine
however we need to turn in our results. Is it possible to put all my SQL
queries in a file and have Access run through the file and output the
results to another file or something along those lines? I'm prefer to
avoid having to copy and paste the results into excel or something else
in order to turn them in.
The second question involves creating the tables. I was able to get the
syntax correct for creating the tables without foreign keys, and I was
able to get the syntax correct even when specifying a foreign key as
long as I didn't specify "on update cascade on delete cascade". For some
reason Acccess would fail on "update" or if I put the "on delete" first
it would fail on "delete" keyword.
The command I'm using is:
CREATE TABLE temp ( TAGNUM INT NOT NULL,COMPID TEXT(20), EMPNUM INT,
LOCATION TEXT(20),PRIMARY KEY (TAGNUM), CONSTRAINT EMPNUM_FK FOREIGN KEY
(EMPNUM) REFERENCES Employee ON DELETE CASCADE ON UPDATE CASCADE);
and the error is "syntax error in constraint clause" and it highlights
"delete".
Can anyone tell me what is wrong?
thanks
I have 2 questions. I'm new to Access and have a high level DB class
where the current project is simply to implement a db using Access. I'm
relatively familiar with SQL and so far haven't had any issues with the
actual queries. We have to create tables, populate them, and then run
queries against them. I've already run the queries and they run fine
however we need to turn in our results. Is it possible to put all my SQL
queries in a file and have Access run through the file and output the
results to another file or something along those lines? I'm prefer to
avoid having to copy and paste the results into excel or something else
in order to turn them in.
The second question involves creating the tables. I was able to get the
syntax correct for creating the tables without foreign keys, and I was
able to get the syntax correct even when specifying a foreign key as
long as I didn't specify "on update cascade on delete cascade". For some
reason Acccess would fail on "update" or if I put the "on delete" first
it would fail on "delete" keyword.
The command I'm using is:
CREATE TABLE temp ( TAGNUM INT NOT NULL,COMPID TEXT(20), EMPNUM INT,
LOCATION TEXT(20),PRIMARY KEY (TAGNUM), CONSTRAINT EMPNUM_FK FOREIGN KEY
(EMPNUM) REFERENCES Employee ON DELETE CASCADE ON UPDATE CASCADE);
and the error is "syntax error in constraint clause" and it highlights
"delete".
Can anyone tell me what is wrong?
thanks