Link to home
Start Free TrialLog in
Avatar of drtopserv
drtopservFlag for Israel

asked on

workspace creation in access 2010

Hi,
I put this in a form in access :

Workspace.CreateDatabase(ByVal Name As String, _
                   ByVal locale As String, _
                   ByVal options As Variant) As Database


Private Sub cmdDatabase_Click()
    DBEngine.Workspaces(0).CreateDatabase("Exercise.accdb", . . .)
End Sub


not working when i click on the button in the access form ..
may any help  :}
Avatar of als315
als315
Flag of Russian Federation image

Try to use this code:
Private Sub cmdDatabase_Click()
    Dim dbs as DAO.Database
    Set dbs = DBEngine.Workspaces(0).CreateDatabase("Exercise.accdb", dbLangGeneral)
    dbs.close
End Sub

Open in new window

Avatar of drtopserv

ASKER

Yea i know that through DAO i can create the db.
but i`m asking why through the code i paste above can`t able to run it ..
it is just to learning purpose.
ASKER CERTIFIED SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial