Saif Saif - 11 days ago 7
Vb.net 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

1st Result from Google

http://www.setha.info/ict-visualbasic6/76-ict-vb6-0016.html

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