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 creating my database?
 
J

JohnFol

This code does not open an instance of Access, so it is not a problem with
the code listed.

Which version of VB are you using?
 

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