J
John
I am creating an Access database in VB, using:
Dim db AS DAO.Database
Dim td AS DAO.TableDef
Set db = DBEngine.CreateDatabase("DbaseName",
dbLangGeneral)
Set td = db.CreateTableDef("TableName")
With td
.Fields.Append .CreateField("First Name", dbText)
.Fields.Append .CreateField("Last Name", dbText)
End With
db.TableDefs.Append td
db.close
Set db = Nothing
Set db = Nothing
This works OK and the new database is created, but after
executing this code I have a minimised Access open and not
showing any database (i.e. just the application open and
minimised). Access stays open until I stop Visual Basic
and then it dissapears, so it would seem that something in
Visual Basic is keeping Access open.
What can I do in VB so that I do not get this open Access
Application after creatring my database?
Dim db AS DAO.Database
Dim td AS DAO.TableDef
Set db = DBEngine.CreateDatabase("DbaseName",
dbLangGeneral)
Set td = db.CreateTableDef("TableName")
With td
.Fields.Append .CreateField("First Name", dbText)
.Fields.Append .CreateField("Last Name", dbText)
End With
db.TableDefs.Append td
db.close
Set db = Nothing
Set db = Nothing
This works OK and the new database is created, but after
executing this code I have a minimised Access open and not
showing any database (i.e. just the application open and
minimised). Access stays open until I stop Visual Basic
and then it dissapears, so it would seem that something in
Visual Basic is keeping Access open.
What can I do in VB so that I do not get this open Access
Application after creatring my database?