Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Field types available for use with "CREATE TABLE" in Microsoft Access

I have the displeasure of generating table creation scripts for Microsoft Access. I have not yet found any documentation describing what the syntax is for the various types. I have found the documentation for the Create Table statement in Access but there is little mention of the types that can be used. For example:

CREATE TABLE Foo (MyIdField *FIELDTYPE*)

Where FIELDTYPE is one of...? Through trial and error I've found a few like INTEGER, BYTE, TEXT, SINGLE but I would really like to find a page that documents all to make sure I'm using the right ones.

like image 278
Karim Avatar asked Apr 06 '09 12:04

Karim


People also ask

What are the three field types in Access?

Up to 255 characters. Long Text :- Lengthy text or combinations of text and numbers. Up to 63, 999 characters. Number :- Numeric data used in mathematical calculations.

Which of these is used to create a table in MS Access?

Answer: To create a table, select the Create tab in the toolbar at the top of the screen. Then click on the Table Design button in the Tables group.


2 Answers

I've found the table in the link below pretty useful:

http://allenbrowne.com/ser-49.html

It lists what Access's Gui calls each data type, the DDL name, DAO name and ADO name (they are all different...).

like image 174
mavnn Avatar answered Oct 01 '22 19:10

mavnn


Some of the best documentation from Microsoft on the topic of SQL Data Definition Language (SQL DDL) for ACE/Jet can be found here:

Intermediate Microsoft Jet SQL for Access 2000

Of particular interest are the synonyms, which are important for writing portable SQL code.

One thing to note is that the Jet 4.0 version of the SQL DDL syntax requires the interface to be in ANSI-92 Query Mode; the article refers to ADO because ADO always uses ANSI-92 Query Mode. The default option for the MS Access interface is ANSI-89 Query Mode, however from Access2003 onwards the UI can be put into ANSI-92 Query Mode. All versions of DAO use ANSI-89 Query Mode. I'm not sure whether SQL DDL syntax was extended for ACE for Access2007.

For more details about query modes, see About ANSI SQL query mode (MDB)

like image 40
onedaywhen Avatar answered Oct 01 '22 20:10

onedaywhen