Saif Saif - 1 year ago 70 Question

How to create table in MS Access 2010 using VB?

How to create table in Ms access 2010 using vb?
Like its very simple question I don't know how to to do it.

If someone can give me helpful links for programming between MS Access and VB I would be thankful.

Answer Source

1st Result from Google

Dim db as DAO.Database
Dim tbd As DAO.TableDef
set db=OpenDatabase("C:\a.mdb")
Set tbd = db.CreateTableDef("tblTest")
With tbd
  .Fields.Append .CreateField("ID", dbText)
  .Fields.Append .CreateField("Name", dbText)
  .Fields.Append .CreateField("Sex", dbText)
  .Fields.Append .CreateField("DOB", dbDate)
End With
db.TableDefs.Append tbd
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download