Hi
I'm trying to create new database but get runtime err 3204 "Database already exists" however i thought the kill removes it, also i cannot actually see the database after code runs 1st time round. Code is as per the help files:
Sub createnewdb()
Dim dbnew As Database
Dim wrkDflt As Workspace
Set wrkDflt = DBEngine.Workspaces(0)
If Dir("c:\temp\newDB.mdb") <> "" Then Kill "c:\temp\newDB.mdb"
Set dbnew = wrkDflt.CreateDatabase("newdb.mdb", dbLangGeneral)
YOur help much appreciated.
Thanks,
M

I'm trying to create new database but get runtime err 3204 "Database already exists" however i thought the kill removes it, also i cannot actually see the database after code runs 1st time round. Code is as per the help files:
Sub createnewdb()
Dim dbnew As Database
Dim wrkDflt As Workspace
Set wrkDflt = DBEngine.Workspaces(0)
If Dir("c:\temp\newDB.mdb") <> "" Then Kill "c:\temp\newDB.mdb"
Set dbnew = wrkDflt.CreateDatabase("newdb.mdb", dbLangGeneral)
YOur help much appreciated.
Thanks,
M
