PC Review


Reply
Thread Tools Rate Thread

Can't delete table "You do not have the necessary permisions to us

 
 
Stuart Bratesman
Guest
Posts: n/a
 
      22nd Oct 2009
I have an Access 2000 mdb database (for backwards compatibility) that I
developed in Access 2007. It is protected by User Level Security. When it
opens, it imports three tables from a user-level secured backend database,
runs some queries, prints a report, and then deletes the three imported
tables before closing.*

It was working fine yesterday, but today when the VBA code tries to delete
any of the three imported tables, it generates the dreaded runtime error
3033, "You do not have the necessary permisions to use the [table name]
object. Have your system administrator or the person who created this object
establish the appropriate permissions for you."

I am using the database as the database owner and I (and all the Full Data
Users) are assigned every User Permission you can find in the User and Group
Permissions dialogue box.

Here is the VBA code that deletes the three imported tables:

'############################
Private Sub btnDeleteTables_Click()

Dim dbs As Object
Dim dbs1 As Database
Dim obj As AccessObject

Set dbs = Application.CurrentData
Set dbs1 = OpenDatabase(Application.CurrentProject.FullName)

' Search the AllTables collection for any of the
' three imported tables and delete each one.

For Each obj In dbs.AllTables

Select Case obj.Name
Case "Table1"
dbs1.Execute "DROP TABLE " & obj.Name
Case "Table2"
dbs1.Execute "DROP TABLE " & obj.Name
Case "Table3"
dbs1.Execute "DROP TABLE " & obj.Name
End Select

Next obj

dbs1.Close

End Sub
'####################

The line that triggers the error is,

dbs1.Execute "DROP TABLE " & obj.Name
in,
Select Case obj.Name
Case "Table1"
dbs1.Execute "DROP TABLE " & obj.Name

As I wrote, it worked like a charm yesterday. I can't think of anything I
did in other parts of the code that would affect this sub-routine.

No changes have been made in the User and Group Permissions dialogue box. I
have Administrator permissions for all three of the imported tables.

Any answers or suggestions would be greatly appreciated.

- Stuart Bratesman
_________________________________________
* User Level Security is required for the backend database since it also
uses Replication to allow users to detact their laptop from their network and
collect data in the field. The three table have to be imported. They cannot
be linked because the backend mdb file has an apostrophe in its file name.
When a table is linked from a database with Access Restricted Characters in
its file name, an error prevents one from being able to delete the links.
Any query that is based on one of these linked table cannot be re-opened in
Design View. The backend's file name is going to change in the next version
upgrade.

--
Stuart Bratesman, Jr., MPP
Muskie School of Public Service
Univ. of Southern Maine
Portland, Maine
 
Reply With Quote
 
 
 
 
Stuart Bratesman
Guest
Posts: n/a
 
      22nd Oct 2009
I've found an alternative solution.

I was able to create a SQL Data Definition query for each of the tables I
wanted to delete. Example:

DROP TABLE Table1;

Then I used a VBA command:

DoCmd.OpenQuery "qryDrop_Table1"

to run each of the three data definition queries. The tables are gone and
there are no error messages. Yipee!

- Stuart Bratesman

The run

--
Stuart Bratesman, Jr., MPP
Muskie School of Public Service
Univ. of Southern Maine
Portland, Maine


"Stuart Bratesman" wrote:

> I have an Access 2000 mdb database (for backwards compatibility) that I
> developed in Access 2007. It is protected by User Level Security. When it
> opens, it imports three tables from a user-level secured backend database,
> runs some queries, prints a report, and then deletes the three imported
> tables before closing.*
>
> It was working fine yesterday, but today when the VBA code tries to delete
> any of the three imported tables, it generates the dreaded runtime error
> 3033, "You do not have the necessary permisions to use the [table name]
> object. Have your system administrator or the person who created this object
> establish the appropriate permissions for you."
>
> I am using the database as the database owner and I (and all the Full Data
> Users) are assigned every User Permission you can find in the User and Group
> Permissions dialogue box.
>
> Here is the VBA code that deletes the three imported tables:
>
> '############################
> Private Sub btnDeleteTables_Click()
>
> Dim dbs As Object
> Dim dbs1 As Database
> Dim obj As AccessObject
>
> Set dbs = Application.CurrentData
> Set dbs1 = OpenDatabase(Application.CurrentProject.FullName)
>
> ' Search the AllTables collection for any of the
> ' three imported tables and delete each one.
>
> For Each obj In dbs.AllTables
>
> Select Case obj.Name
> Case "Table1"
> dbs1.Execute "DROP TABLE " & obj.Name
> Case "Table2"
> dbs1.Execute "DROP TABLE " & obj.Name
> Case "Table3"
> dbs1.Execute "DROP TABLE " & obj.Name
> End Select
>
> Next obj
>
> dbs1.Close
>
> End Sub
> '####################
>
> The line that triggers the error is,
>
> dbs1.Execute "DROP TABLE " & obj.Name
> in,
> Select Case obj.Name
> Case "Table1"
> dbs1.Execute "DROP TABLE " & obj.Name
>
> As I wrote, it worked like a charm yesterday. I can't think of anything I
> did in other parts of the code that would affect this sub-routine.
>
> No changes have been made in the User and Group Permissions dialogue box. I
> have Administrator permissions for all three of the imported tables.
>
> Any answers or suggestions would be greatly appreciated.
>
> - Stuart Bratesman
> _________________________________________
> * User Level Security is required for the backend database since it also
> uses Replication to allow users to detact their laptop from their network and
> collect data in the field. The three table have to be imported. They cannot
> be linked because the backend mdb file has an apostrophe in its file name.
> When a table is linked from a database with Access Restricted Characters in
> its file name, an error prevents one from being able to delete the links.
> Any query that is based on one of these linked table cannot be re-opened in
> Design View. The backend's file name is going to change in the next version
> upgrade.
>
> --
> Stuart Bratesman, Jr., MPP
> Muskie School of Public Service
> Univ. of Southern Maine
> Portland, Maine

 
Reply With Quote
 
Catherine Sea
Guest
Posts: n/a
 
      26th Oct 2009
Thanks for your information.

Cathrine Sea
http://www.dynamsoft.com
http://www.scmsoftwareconfigurationmanagement.com/

"Stuart Bratesman" wrote:

> I've found an alternative solution.
>
> I was able to create a SQL Data Definition query for each of the tables I
> wanted to delete. Example:
>
> DROP TABLE Table1;
>
> Then I used a VBA command:
>
> DoCmd.OpenQuery "qryDrop_Table1"
>
> to run each of the three data definition queries. The tables are gone and
> there are no error messages. Yipee!
>
> - Stuart Bratesman
>
> The run
>
> --
> Stuart Bratesman, Jr., MPP
> Muskie School of Public Service
> Univ. of Southern Maine
> Portland, Maine
>
>
> "Stuart Bratesman" wrote:
>
> > I have an Access 2000 mdb database (for backwards compatibility) that I
> > developed in Access 2007. It is protected by User Level Security. When it
> > opens, it imports three tables from a user-level secured backend database,
> > runs some queries, prints a report, and then deletes the three imported
> > tables before closing.*
> >
> > It was working fine yesterday, but today when the VBA code tries to delete
> > any of the three imported tables, it generates the dreaded runtime error
> > 3033, "You do not have the necessary permisions to use the [table name]
> > object. Have your system administrator or the person who created this object
> > establish the appropriate permissions for you."
> >
> > I am using the database as the database owner and I (and all the Full Data
> > Users) are assigned every User Permission you can find in the User and Group
> > Permissions dialogue box.
> >
> > Here is the VBA code that deletes the three imported tables:
> >
> > '############################
> > Private Sub btnDeleteTables_Click()
> >
> > Dim dbs As Object
> > Dim dbs1 As Database
> > Dim obj As AccessObject
> >
> > Set dbs = Application.CurrentData
> > Set dbs1 = OpenDatabase(Application.CurrentProject.FullName)
> >
> > ' Search the AllTables collection for any of the
> > ' three imported tables and delete each one.
> >
> > For Each obj In dbs.AllTables
> >
> > Select Case obj.Name
> > Case "Table1"
> > dbs1.Execute "DROP TABLE " & obj.Name
> > Case "Table2"
> > dbs1.Execute "DROP TABLE " & obj.Name
> > Case "Table3"
> > dbs1.Execute "DROP TABLE " & obj.Name
> > End Select
> >
> > Next obj
> >
> > dbs1.Close
> >
> > End Sub
> > '####################
> >
> > The line that triggers the error is,
> >
> > dbs1.Execute "DROP TABLE " & obj.Name
> > in,
> > Select Case obj.Name
> > Case "Table1"
> > dbs1.Execute "DROP TABLE " & obj.Name
> >
> > As I wrote, it worked like a charm yesterday. I can't think of anything I
> > did in other parts of the code that would affect this sub-routine.
> >
> > No changes have been made in the User and Group Permissions dialogue box. I
> > have Administrator permissions for all three of the imported tables.
> >
> > Any answers or suggestions would be greatly appreciated.
> >
> > - Stuart Bratesman
> > _________________________________________
> > * User Level Security is required for the backend database since it also
> > uses Replication to allow users to detact their laptop from their network and
> > collect data in the field. The three table have to be imported. They cannot
> > be linked because the backend mdb file has an apostrophe in its file name.
> > When a table is linked from a database with Access Restricted Characters in
> > its file name, an error prevents one from being able to delete the links.
> > Any query that is based on one of these linked table cannot be re-opened in
> > Design View. The backend's file name is going to change in the next version
> > upgrade.
> >
> > --
> > Stuart Bratesman, Jr., MPP
> > Muskie School of Public Service
> > Univ. of Southern Maine
> > Portland, Maine

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Delete query and "Could not delete from specified Table" John Spencer MVP Microsoft Access Queries 0 23rd Apr 2009 02:31 PM
Re: delete duplicates "specify the table containing the records you want to delete" Allen Browne Microsoft Access Queries 0 24th Feb 2009 12:45 PM
the "save" and "delete" disappeared from the menu table... =?Utf-8?B?dGhyZWV6ZXRh?= Windows XP Help 0 24th Jun 2005 08:12 PM
Get the users's permisions for each table Dei Microsoft ADO .NET 2 1st Oct 2004 02:48 PM
Add user and set permisions for each table Dei Microsoft ADO .NET 1 29th Sep 2004 02:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:16 PM.