Hi
I'm trying to create multiple tables in Access using SQL but an error keeps appearing. Access is not recognising the second Create Table command. Can you create multiple tables in access using SQL in the same query module?
The error is 'Syntax Error' 'Create Table Statement' Any clues?
I have not idea why it isn't working.Create Table Vehicle (
CarType CHAR (30) NOT NULL,
Registration Char(30),
Year Char(30),
Phone Char (13),
Fax Char(13),
ContactPerson Char(30) ) ;
Create Table Owner (
Name Char (30) NOT NULL,
NextOfKin Char(30) ) ;
Thanks so much
Danny2000
![]()
Last edited by danny2000; 05-05-2009 at 05:37 AM.
Hi danny2000,
The short answer to your question about creating multiple tables would be "no".
Access re-writes your SQL statement into the QBE graphical query interface. Since the QBE is set only to interpret one valid query at a time, it'll choke if you put in more than one. You can get away with sub-queries using SELECT, but not with action commands like CREATE TABLE.
Since Access SQL uses the semi-colon to end the SQL statement, it'll see what you've written as a valid statement (up to the semi-colon) followed by it's interpretation of a Syntax error.
You'll need to write the CREATE TABLE queries as two separate statements/queries.
Cheers,
Docendo discimus.
Please consider:
- Thanking those who helped you. Click the reputation icon
in the contributor's post and add Reputation.
- Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.
Excellent explanation. Thanks very much for coming back.
I fully understand now.
Danny2000
![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks