B
Bryan Hughes
Hello,
I am having a problem with the deleting a temp mdb.
I am using the code from Tony Towes' website
http://www.granite.ab.ca/access/temptables.htm to create and delete the mdb.
The temp mdb is created just fine, but I keep getting error code 70
("Permission Denied") when I try and delete it.
Even if I just create the mdb and not create and link any tables to it, I
still get the error code.
What is the porblem
This is the code to create the mdb
' Get default Workspace.
Set wrkDefault = DBEngine.Workspaces(0)
strTempDatabase = Left(CurrentDb.Name, Len(CurrentDb.Name) - 4) &
"_temp.mdb"
' Make sure there isn't already a file with the name of
' the new database.
If Dir(strTempDatabase) <> "" Then Kill strTempDatabase
'Create a new temp database
Set dbsTemp = wrkDefault.CreateDatabase(strTempDatabase, dbLangGeneral)
This is the code to delete the mdb
' Delete the temp mdb
Set wrkDefault = DBEngine.Workspaces(0)
strTempDatabase = Left(CurrentDb.Name, Len(CurrentDb.Name) - 4) &
"_temp.mdb"
Kill (strTempDatabase)
What did I miss?
-TFTH
Bryan
I am having a problem with the deleting a temp mdb.
I am using the code from Tony Towes' website
http://www.granite.ab.ca/access/temptables.htm to create and delete the mdb.
The temp mdb is created just fine, but I keep getting error code 70
("Permission Denied") when I try and delete it.
Even if I just create the mdb and not create and link any tables to it, I
still get the error code.
What is the porblem
This is the code to create the mdb
' Get default Workspace.
Set wrkDefault = DBEngine.Workspaces(0)
strTempDatabase = Left(CurrentDb.Name, Len(CurrentDb.Name) - 4) &
"_temp.mdb"
' Make sure there isn't already a file with the name of
' the new database.
If Dir(strTempDatabase) <> "" Then Kill strTempDatabase
'Create a new temp database
Set dbsTemp = wrkDefault.CreateDatabase(strTempDatabase, dbLangGeneral)
This is the code to delete the mdb
' Delete the temp mdb
Set wrkDefault = DBEngine.Workspaces(0)
strTempDatabase = Left(CurrentDb.Name, Len(CurrentDb.Name) - 4) &
"_temp.mdb"
Kill (strTempDatabase)
What did I miss?
-TFTH
Bryan