473,388 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Problem with MSysTable object permission

44
Hi,
who can tell me what this error message means and what I have to do to solve the issue?

"You do not have the necessary permission to use the 'MSysTables' object. Have your system administrator or the person who created this object establish the appropriate permissions for you."

I'm the administrator and this happens with on of the users logon. I gave this user 'Read', 'Read Design' and 'Modify Design' access to that query, because the user needs to set a criteria.

Quick advice is much appreciated.

Thanks.
Oct 18 '06 #1
12 3583
PEB
1,418 Expert 1GB
In fact this is system table! Is need to access just this table? This can be wormfull for your database!
Oct 21 '06 #2
isetea
44
I'm not sure, if I get your point. But I gave the group (not the single user, sorry I forgot to say) access to the tables underlying the specific query as well. The group has now read, read design, modify and update access to all data what is linked to the query in any way. It didn't work out...

In fact this is system table! Is need to access just this table? This can be wormfull for your database!
Oct 22 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
What is the query?



I'm not sure, if I get your point. But I gave the group (not the single user, sorry I forgot to say) access to the tables underlying the specific query as well. The group has now read, read design, modify and update access to all data what is linked to the query in any way. It didn't work out...
Oct 22 '06 #4
isetea
44
Private Sub Open1_Click()

On Error GoTo Err_macro1_Click

Dim db As DAO.Database
Dim strSQL As String
Dim qdf As DAO.QueryDef
Dim sFilter As String
Dim SFilter2 As String

Set db = CurrentDb()

sFilter = MultiSelectSQL(cboDept)
sFilter2 = MultiSelectSQL(cboStat)

' Close Temp Query
DoCmd.Close acQuery, "qry_011_Select_Agent_Numbers_National"

' Delete Temp Query
DoCmd.DeleteObject acQuery, "qry_011_Select_Agent_Numbers_National"

' Construct SQL statement
strSQL = "SELECT [tbl_004_Agent Numbers].Name, [tbl_004_Agent Numbers].[Staff No]," & _
"[qry_003_Subquery_Select_Staff_Details].Title, [qry_002_Subquery_Select_Dpeartment_Details].[Dept Name]," & _
"[qry_003_Subquery_Select_Staff_Details].[Employment Status New]," & _
"[tbl_004_Agent Numbers].AFSL, [tbl_004_Agent Numbers].[Individual ID]," & _
"[tbl_004_Agent Numbers].[CAPS ID], [tbl_004_Agent Numbers].[Primary CAPS]," & _
"[tbl_004_Agent Numbers].[CFS ID], [tbl_004_Agent Numbers].[CBA Short Name]," & _
"FROM ([qry_002_Subquery_Select_Dpeartment_Details] INNER JOIN [qry_003_Subquery_Select_Staff_Details] " & _
"ON [qry_002_Subquery_Select_Dpeartment_Details].OUN = [qry_003_Subquery_Select_Staff_Details].OUN)" & _
"INNER JOIN [tbl_004_Agent Numbers] " & _
"ON [qry_003_Subquery_Select_Staff_Details].[Staff No] = [tbl_004_Agent Numbers].[Staff No]" & _
"WHERE ([tbl_004_Agent Numbers].[Staff No] > 100 and " & _
"[qry_002_Subquery_Select_Dpeartment_Details].[Dept Name] " & sFilter & " and " & _
"qry_003_Subquery_Select_Staff_Details.[Employment Status New] " & SFilter2 & ")" & _
" ORDER BY [tbl_004_Agent Numbers].[Staff No];"

Debug.Print strSQL
' Create query and provide it with its SQL statement

Set qdf = db.CreateQueryDef("qry_011_Select_Agent_Numbers_Na tional", strSQL)
' Open query for user

DoCmd.OpenQuery "qry_011_Select_Agent_Numbers_National"
Open1_Click_Click:

Exit Sub

Err_macro1_Click:
MsgBox Err.Description
Resume Open1_Click_Click

End Sub
Oct 23 '06 #5
MMcCarthy
14,534 Expert Mod 8TB
Firstly, you create the query but you never delete it.


also there were some errors in your query. I've simplified it and corrected what I've found. Try it and see if it makes a difference.

strSQL = "SELECT T4.Name, T4.[Staff No], Q3.Title, Q2.[Dept Name]," & _
"Q3.[Employment Status New], T4.AFSL, T4.[Individual ID]," & _
"T4.[CAPS ID], T4.[Primary CAPS], T4.[CFS ID], T4.[CBA Short Name]," & _
"FROM ([qry_002_Subquery_Select_Dpeartment_Details] Q2 " & _
"INNER JOIN [qry_003_Subquery_Select_Staff_Details] Q3 " & _
"ON Q2.OUN = Q3.OUN) INNER JOIN [tbl_004_Agent Numbers] T4 " & _
"ON Q3.[Staff No] = T4.[Staff No] " & _
"WHERE ((T4.[Staff No] > 100) And (Q2.[Dept Name]='" & sFilter & "') " & _
"AND (Q3.[Employment Status New]='" & SFilter2 & "')) " & _
"ORDER BY T4.[Staff No];"
Oct 23 '06 #6
isetea
44
Hi

I thought I delete the query very in the beginning with:

' Delete Temp Query
DoCmd.DeleteObject acQuery, "qry_011_Select_Agent_Numbers_National"

And the query is working as expected at the moment. I also don't have a problem with my query, but with the user-group permission to run the query through a form. Running the query while selecting the single query without the form the permission works perfectly.

I also don't know what you modification means. Does it is a real change in the query logic? What does it correct exactly? Maybe you can help me to see the amendment...

Thanks

Firstly, you create the query but you never delete it.


also there were some errors in your query. I've simplified it and corrected what I've found. Try it and see if it makes a difference.

strSQL = "SELECT T4.Name, T4.[Staff No], Q3.Title, Q2.[Dept Name]," & _
"Q3.[Employment Status New], T4.AFSL, T4.[Individual ID]," & _
"T4.[CAPS ID], T4.[Primary CAPS], T4.[CFS ID], T4.[CBA Short Name]," & _
"FROM ([qry_002_Subquery_Select_Dpeartment_Details] Q2 " & _
"INNER JOIN [qry_003_Subquery_Select_Staff_Details] Q3 " & _
"ON Q2.OUN = Q3.OUN) INNER JOIN [tbl_004_Agent Numbers] T4 " & _
"ON Q3.[Staff No] = T4.[Staff No] " & _
"WHERE ((T4.[Staff No] > 100) And (Q2.[Dept Name]='" & sFilter & "') " & _
"AND (Q3.[Employment Status New]='" & SFilter2 & "')) " & _
"ORDER BY T4.[Staff No];"
Oct 23 '06 #7
MMcCarthy
14,534 Expert Mod 8TB
Firstly there were spacing problems.
Secondly you had no '=' signs in your where statement and your parameters weren't correctly identified as strings. Running a query through vba has different syntax.

Have you tried running with this amended query?
Oct 23 '06 #8
isetea
44
The code you gave me I firstly had, but it was not working with the result. That's why I have no "=".
Now entering the one again the following error pops up:

Syntax Error (missing operator) in query expression '((T4.[Staff No] > 100) And (Q2.[Dept Name]=' = 'Spec Dist - NSW North") AND (Q3.[Employment Status]=' = ' Current"))'.

Due to my previous experience it happens becauseof the "=" sign. I was trying so long with the Immediate result window till the outcome was equal to what a query sql would look like and so I resulted my code.

Is your code working for you?

Firstly there were spacing problems.
Secondly you had no '=' signs in your where statement and your parameters weren't correctly identified as strings. Running a query through vba has different syntax.

Have you tried running with this amended query?
Oct 23 '06 #9
isetea
44
You probably need to know the Multiselect function I have for sFilter to understand Why the VBA was in that way I had.

Public Function MultiSelectSQL(ctl As Control, Optional Delimiter As String) As String

Dim sResult As String, vItem As Variant
With ctl
Select Case .ItemsSelected.Count
Case 0: sResult = " Is Null "
Case 1: sResult = " = '" & Delimiter & .ItemData(.ItemsSelected(0)) & Delimiter & "'"
Case Else
sResult = " in ("For Each vItem In .ItemsSelected sResult = sResult & Delimiter & "'" & .ItemData(vItem) & Delimiter & "'" & ","
Next vItem Mid(sResult, Len(sResult), 1) = ")"
End Select
End With
MultiSelectSQL = sResult
End Function
Oct 23 '06 #10
MMcCarthy
14,534 Expert Mod 8TB
Can you post the original query and I can check the syntax against it.

As you have obviously put the operators and single quotes into variables.

change the where statement back to the following leaving everything else as I gave it to you:

"WHERE ((T4.[Staff No] > 100) and " & _
"(Q2.[Dept Name]" & sFilter & ") and " & _
"(Q3.[Employment Status New] " & SFilter2 & ")) " & _
"ORDER BY T4.[Staff No];"
Oct 23 '06 #11
isetea
44
This is the temp query sql from a couple of days ago.

SELECT [tbl_004_Agent Numbers].Name,
[tbl_004_Agent Numbers].[Staff No], [qry_003_Subquery_Select_Staff_Details].Title, [qry_002_Subquery_Select_Dpeartment_Details].[Dept Name], [qry_003_Subquery_Select_Staff_Details].[Employment Status New], [tbl_004_Agent Numbers].AFSL,
[tbl_004_Agent Numbers].[Individual ID],
[tbl_004_Agent Numbers].[CAPS ID],
[tbl_004_Agent Numbers].[Primary CAPS],
[tbl_004_Agent Numbers].[CFS ID],
[tbl_004_Agent Numbers].[CBA Short Name]
FROM (qry_002_Subquery_Select_Dpeartment_Details INNER JOIN qry_003_Subquery_Select_Staff_Details
ON [qry_002_Subquery_Select_Dpeartment_Details].OUN = [qry_003_Subquery_Select_Staff_Details].OUN)
INNER JOIN [tbl_004_Agent Numbers]
ON [qry_003_Subquery_Select_Staff_Details].[Staff No] = [tbl_004_Agent Numbers].[Staff No]
WHERE ([tbl_004_Agent Numbers].[Staff No] > 100 and [qry_002_Subquery_Select_Dpeartment_Details].[Dept Name] in ('Spec Dist - NSW North','Spec Dist - NSW South') and qry_003_Subquery_Select_Staff_Details.[Employment Status New] in ('Current','Exited'))
ORDER BY [tbl_004_Agent Numbers].[Staff No];


I changed the WHERE clause as you told me and it is now working. I will check it with another user reg. the permission problem.
Oct 23 '06 #12
isetea
44
:( Still no change for my security permission problem :(
Oct 23 '06 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Wayne Wengert | last post by:
I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I want to display a list of all tables in an Access database. I want to put that list of table names in a listbox so the user...
3
by: Mark | last post by:
Hi all, i'm trying to serialize a class. Using the constructor of XmlSerializer i get these (odd?) errors: "File or assembly name goseij9w.dll, or one of its dependencies, was not found"....
8
by: JR | last post by:
I have a Web server running on Windows XP. On this Web server, I have a Web site configured with its home directory on a network share. In the Web site, there's a virtual folder pointing to a local...
2
by: Brian Cooper | last post by:
I am trying to determine a permission problem trying to write a text file from one web server to another. Here is the situation: We have two domains in place one is Active Directory and the...
7
by: Andrea Williams | last post by:
I have been using this code for a while now and I haven't changed this code for at least a couple weeks... I do not suspect the code. The error I'm getting is the following: Message: Could not...
1
by: Mark Denardo | last post by:
I stumbled across a weird problem that I don't seem to understand and was wondering if anyone could help explain why it is occurring: Basically I have set up a client/server application where the...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
6
by: Amber | last post by:
do the following steps: 1:Use Manage Studio login the server with Integrated security. 2:Create a dabase named testdb; 3:Create a SQL Server login named amber ,and set it to be dbowner of...
3
by: Bratislav Jevtic | last post by:
Hi, I've just installed Ajax November CTP, changed app according to instructions and I am (was) satisfied. Next step - deployment to server. I'm receiving error:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.