I am writing a VB app. I want to create a table and add some records in it. How can I do this? I also want to know how to get the data from that table.
Thanks alot.
Printable View
I am writing a VB app. I want to create a table and add some records in it. How can I do this? I also want to know how to get the data from that table.
Thanks alot.
If you are using DAO, try something like:
VB Code:
Dim db As DAO.Database Dim tbl As DAO.TableDef Dim fld As Field Set db = OpenDatabase("MyDB.mdb") Set fld = New Field fld.Name = "Name" fld.Type = dbText fld.FieldSize = 20 tbl.Fields.Append fld Set fld = New Field fld.Name = "ID" fld.Type = dbText fld.FieldSize = 10 tbl.Fields.Append fld db.TableDefs.Append tbl