Table DDL

wcboyd

Registered User.
Local time
Yesterday, 18:08
Joined
Aug 30, 2004
Messages
50
Hello All,

I am trying to create a table in access 2003 using DDL, but I am having a wee problem with one of the data types. Decimal to be precise.

Here is my ddl:

Code:
CREATE TABLE SampleDataType (
	Fld_Txt_50 VARCHAR(50),
	Fld_Txt_100 VARCHAR(100),
	Fld_Memo LONGCHAR,
	Fld_Long_Integer INTEGER,
	Fld_Byte BYTE,
	Fld_Integer SMALLINT,
	Fld_Single REAL,
	Fld_Double DOUBLE,
	Fld_Replication_Id GUID,
	Fld_Decimal DECIMAL(18,3),
	Fld_Date_Time DATETIME,
	Fld_Currency CURRENCY,
	Fld_AutoNumber COUNTER NOT NULL,
	Fld_Yes_No BIT NOT NULL,
	Fld_OLE_Object LONGBINARY
);

The only line giving me fits is the "Fld_Decimal".
What am I doing wrong here?

Thanks,
 
i think its the field types there. for example there is no smallint field type in access. I think you should familiarize yourself first with table field types.
 
I think it should be a NUMBER type. Allen Browne has a list on his site.
 
access dont have varchar, longchar, real, datetime, longbinary.
 
George,

Thanks for pointing me to Allen Browne's web site. He does indeed have a listing of DDL, DAO, and ADOX data types. Turns out that you can't access Decimal data type using DDL and the Access Query Interface. You have to use either DAO or ADOX to create a table with a Decimal data type.
What a pain.

Genesis, you are correct in that in the Access GUI interface those data types do not exist, but if you use the DDL I posted, minus the Decimal line, you will find that Access converts them to the correct ones, as shown here:
http://allenbrowne.com/ser-49.html
 

Users who are viewing this thread

Back
Top Bottom