Delete Table with "Engine" owner

G

gaugust

In Access 2003 I am having a problem deleting a table who's current owner is
"Engine". The table was created in code using the sort routine listed below.
When I try to use Security to change the user from "Engine" to "Admin", when
I am logged on as the Admin I get a message: "You don't have permission to
change the owner of 'case2185Sorted". The routine below is supposed to sort
several tables and then delete the old tables. For some reason one of the
sorted tables did not delete. How can I delete the table with "Engine" as the
owner? Thanks.

Public Sub SortTable(SortTable As Variant)
Dim lstrSQL As String
Dim strTable As String
Dim i As Long

For i = 1 To UBound(SortTable)
strTable = SortTable(i) & "Sorted"
'Create sorted table
lstrSQL = "SELECT Control, LName_Con, FName_Con, MRN_Con, ICUdt_Con,
DCdt_Con, EXPTime_Con, Random, Indexdt_Con "
lstrSQL = lstrSQL & "INTO " & strTable & " FROM " & SortTable(i) & "
Order by Random asc"
DoCmd.RunSQL lstrSQL
'Delete unsorted table
DoCmd.DeleteObject acTable, SortTable(i)
'Rename sorted table
DoCmd.Rename SortTable(i), acTable, strTable
Next i

End Sub
 

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