[Access 2007] How do i create table in VBA
Hello.
I want to create a table from VBA code like this example:
Sub CREATE_TABLE()
Dim MySQL As String
MySQL = "CREATE TABLE exTable (ID integer, Name text (50))"
DoCmd.SetWarnings False
DoCmd.RunSQL MySQL
DoCmd.SetWarnings True
End Sub
My problem is i don't know which datatype i should use to create a memo field or how to create an autonumber field.
How many way to create a table automatically through VBA?
Thanks for you answers and please excuse my english.
Re: [Access 2007] How do i create table in VBA
Easiest is manually
Then via sql (although types can be a pain...)
Next through vba, using the DAO and the tabledefs.
Next is ADO using ADOX schema
There is a lot of help on how to do this on msdn.
Have a play and post back your code when you have a question/problem.
Re: [Access 2007] How do i create table in VBA