Source language: Translate to:

Create table Error

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Create table Error

Postby smartmedia » Mon Jul 09, 2007 3:35 am

Hi...

I try to create a new table in Access but i get syntax error and the table are not created... Can you help me...
Here is the code:

dbpCreateAccessDatabase "[PubDir]Favorites.mdb" "Password=code;Encrypted=Yes"

dbpOpenAccessDatabase "Favorites" "[PubDir]favorites.mdb" "code"

dbpCreateTable "Favorites" "Favorites" "id AutoInc Key;Title String(100);Info Memo;Category String(35);SubCategory String(30);Links Memo;Pass String(40);DateInserted DateTime;Size String(8);Status String(1);Username String(20);Lang String(20)"
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Re: Create table Error

Postby dpayer » Mon Jul 09, 2007 6:49 am

smartmedia wrote:Hi...

I try to create a new table in Access but i get syntax error and the table are not created... Can you help me...
Here is the code:



I took your example and changed the name of the table to be different from the name of the database and databaseID and it worked.

That may be an issue.

David P.
User avatar
dpayer
 
Posts: 1383
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby smartmedia » Mon Jul 09, 2007 9:00 am

Hi...

Thanks David but the same error come up to me even when i change the name of database and DatabaseID and Table...

What else can i do...???
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Gaev » Mon Jul 09, 2007 9:48 am

smartmedia:

a) I don't believe that the name of the table is the problem ... I was able to use the favorites name for both the databaseID and tableName.

b) If you remove the id AutoInc Key field definition ... the original error message no longer pops up ... but another one pops up in its place.

c) If you rename the field Size to gkSize ... or something like it ... the second message does not pop upo either.

So perhaps the MSAccess platform ...

i) AutoInc or Key ... or both ... features ?

ii) Size is a Reserved Word and may not be usuable as a field name ?

... see if you can create your original table fields in a mySQL database.
User avatar
Gaev
 
Posts: 3735
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby smartmedia » Mon Jul 09, 2007 11:14 am

Hi...

a) I don't believe that the name of the table is the problem ... I was able to use the favorites name for both the databaseID and tableName.

You right, i be able to create the database with the same ID, file name, table.

b) If you remove the id AutoInc Key field definition ... the original error message no longer pops up ... but another one pops up in its place.

It seems that doesn't accept any key at all, not only the AutoInc Key, i was forced to make the id field as int. (something must be done about this)

c) If you rename the field Size to gkSize ... or something like it ... the second message does not pop upo either.

You right, seems that Size is reserved word. I be happy to know all the reserved words.

Gaev, thanks one more time...
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Mon Jul 09, 2007 11:23 am

The unhelpful error message is coming directly from the database engine.
Apparently the word "size" is a special keyword and can't be used as a
table or field name. The web site below shows a list of keywords for each
database type:

http://sqlserver2000.databases.aspfaq.com/what-are-reserved-access-odbc-and-sql-server-keywords.html

It's quite a long list.

The items under both the Jet and Access columns are the ones relevant to MS Access databases.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest