[Access 2007] How do i create table in VBA (1 Viewer)

dibangdit

New member
Local time
Tomorrow, 03:18
Joined
May 20, 2008
Messages
2
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.
 

ErikSnoek

Programmer
Local time
Today, 13:18
Joined
Apr 26, 2007
Messages
100
Autonumber = counter
Memo = memo

e.g.:
"CREATE TABLE exTable (ID counter, Name memo)"
Creates a table with an autonumber field named "ID" and a memo field called "Name".
 

dibangdit

New member
Local time
Tomorrow, 03:18
Joined
May 20, 2008
Messages
2
Thank you, ErikSnoek.
 

Users who are viewing this thread

Top Bottom