HI
what are datatypes we can use in microsoft access
for character,date,time,numeric and pls. do tell their
syntax
eg
create table aa(
name char(30),
e_date date,
amt number(10,2));
to programatically create a table in Access you would need to use something like the following;
Code:
Dim db As DAO.Database
Dim tdfTable As New DAO.TableDef
Dim fld1 As New DAO.Field
Dim fld2 As New DAO.Field
Dim fld3 As New DAO.Field
Set db = CurrentDb
tdfTable.Name = "aa"
With fld1
.Type = dbText
.Name = "Name"
End With
With fld2
.Type = dbDate
.Name = "e_date"
End With
With fld3
.Type = dbLong
.Name = "amt"
End With
With tdfTable.Fields
.Append fld1
.Append fld2
.Append fld3
End With
With db.TableDefs
.Append tdfTable
.Refresh
End With
Application.RefreshDatabaseWindow
To the best of my knowledge Access doesnt support the 'CREATE' command and its Make Table query isnt applicable to what you need to do.
Hope that points you in the right direction.
Simon
----------------------------------------
Of all the things I have lost in my life, the thing I miss the MOST is my mind!
----------------------------------------
This will give you your three field (you can change Fld1, Fld2 and Fld3 to other names). I'm not sure how you format those datetime and number fields. If I figure that out, I will post that info.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.