-
May 19th, 2008, 09:35 PM
#1
Thread Starter
New Member
[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.
Last edited by dibangdit; May 19th, 2008 at 09:49 PM.
-
May 20th, 2008, 03:59 AM
#2
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.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
May 21st, 2008, 11:34 PM
#3
Thread Starter
New Member
Re: [Access 2007] How do i create table in VBA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|