PDA

View Full Version : CREATE TABLE syntax error



better
03-10-2006, 09:12 AM
Hello again!

I'm trying to create and populate a table to be imported into MS Project as a task list, from other tables in an Access database. I can't seem to get the "CREATE TABLE" SQL statement to work correctly. I can create a table, but I can't get any cloumns into it. I'm trying to do this using ASP, but I can't get it to work directly inside Access either. Here's the syntax I'm using:

CREATE TABLE NewJob (Task TEXT(50), OutlineLvl INTEGER(1))

It gives me a syntax error in the CREATE TABLE clause, and when I do it inside Access, the debugger highlights the ( delimiting the column definitions, and continues to highlight anything to the right of the table name.

Help!?

Norie
03-10-2006, 10:42 AM
Why do you have (1) after INTEGER?

better
03-10-2006, 11:05 AM
Why do you have (1) after INTEGER?

Field length... Unless I'm mistaken, MS Project only has 9 outline levels. Actually, I just managed to accomplish what I was trying to accomplish by using a SELECT INTO FROM query structure.

Norie
03-10-2006, 11:17 AM
As far as I can remember, can't seem to find the Help topic, you don't set the length of number fields when creating a table.

This worked for me.

CREATE TABLE NewJob (Task TEXT(50), OutlineLvl INTEGER)