Open Access Application

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?
 
V

Van T. Dinh

If you meant the stand alone Visual Basic then I am sure
the problem is some other parts of your code. AFAICS, the
posted code only uses VB and DAO to create a JET mdb
database and got nothing to do with Access.

HTH
Van T. Dinh
MVP (Access)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top