Make Table Code Not Working

Geoff Codd

Registered User.
Local time
Today, 17:43
Joined
Mar 6, 2002
Messages
190
I apologise if I am being stupid, but this is the first time I have triend tis and I can't get it to work

Sub CreateTableTestTable()

Dim dbs As Database

Set dbs = OpenDatabase("C:\Program Files\em\EM_UoM_ENRep.mdb")

dbs.Execute "CREATE TABLE TestTable" _
& "(Mnemonic CHAR, Date DATETIME," _
& "Time DATETIME, Value DOUBLE," _
& "CONSTRAINT TestTableConstraint UNIQUE" _
& "(Mnemonic, Date, Time));"

dbs.Close

End Sub

All help appreciated
thanks
geoff
 
Try using dbs.tabledefs instead....

Regards
Geoff Codd said:
I apologise if I am being stupid, but this is the first time I have triend tis and I can't get it to work

Sub CreateTableTestTable()

Dim dbs As Database

Set dbs = OpenDatabase("C:\Program Files\em\EM_UoM_ENRep.mdb")

dbs.Execute "CREATE TABLE TestTable" _
& "(Mnemonic CHAR, Date DATETIME," _
& "Time DATETIME, Value DOUBLE," _
& "CONSTRAINT TestTableConstraint UNIQUE" _
& "(Mnemonic, Date, Time));"

dbs.Close

End Sub

All help appreciated
thanks
geoff
 
thanks for the reply, but i'm not sure what you mean

thanks
geoff
 
If you lookup the tabledefs property in the access help you should be able to use that to create a new table in you database....

Regards
 
Hi there,

I've searched the help files but I'm still struggling to find anything relevent, could you cut and paste a sample from your help files

Thanks
Geoff
 

Users who are viewing this thread

Back
Top Bottom