G
Giem
Hey all,
I am trying to delete a table in the backend database using code in the
button on the frontend.
I know there was a post already answered concerning this, the answer using
this example:
Dim dbCurr As DAO.Database
Set dbCurr = OpenDatabase("E:\Folder\BackEnd.mdb")
dbCurr.TableDefs.Delete "MyOldTable"
My problem is, it's not actually deleting the table. I know this because
afterward there is a query executed that remakes the table. It gives me the
error "Table 'X' already exists." If you open the backend after stepping past
the delete part, it is still there as well, And I am making sure the backend
is not open or locked in any way when this is running.
I was also wondering about DeleteObject, having the backend database checked
as a library reference. As I understood, Access will look at a library object
first with certain syntax? There is a link to this table in question in the
frontend, for querys used in the frontend afterwards. I want to avoid getting
that included in the mix.
Anyway, an explanation of what could be missing on my part for the DAO
method, alternatives to the DAO method, making a make table query to just
shut up and do it and wipe the old one, or another way of doing it altogether
is greatly appreciated.
I am trying to delete a table in the backend database using code in the
button on the frontend.
I know there was a post already answered concerning this, the answer using
this example:
Dim dbCurr As DAO.Database
Set dbCurr = OpenDatabase("E:\Folder\BackEnd.mdb")
dbCurr.TableDefs.Delete "MyOldTable"
My problem is, it's not actually deleting the table. I know this because
afterward there is a query executed that remakes the table. It gives me the
error "Table 'X' already exists." If you open the backend after stepping past
the delete part, it is still there as well, And I am making sure the backend
is not open or locked in any way when this is running.
I was also wondering about DeleteObject, having the backend database checked
as a library reference. As I understood, Access will look at a library object
first with certain syntax? There is a link to this table in question in the
frontend, for querys used in the frontend afterwards. I want to avoid getting
that included in the mix.
Anyway, an explanation of what could be missing on my part for the DAO
method, alternatives to the DAO method, making a make table query to just
shut up and do it and wipe the old one, or another way of doing it altogether
is greatly appreciated.