I have an app where I'm replicating some of the functionality in User Manager, and am accessing the Users table in the Rules DB to create a User subpart collection. The code to load the users looks like this:
... Try 'Dim strSQL As String = "SELECT [User_ID],[User_Name],[Admin],[Disabled],[License_
Key],[Project_Prefix],[Last_Login],[User_Email],[P assword] FROM Users" Dim strSQL As String = "SELECT * FROM Users" Dim dsUsers As DataSet = g_RulesData.ExecuteSQL(strSQL) If dsUsers.Tables.Count > 0 Then For Each row As DataRow In dsUsers.Tables(0).Rows ...
Running either strSQL throws as an "Invalid SQL statement" exception on the bold line above.
I have very similar code to load the Roles that works fine:
Try Dim strSQL As String = "SELECT * FROM Roles" Dim dsRoles As DataSet = g_RulesData.ExecuteSQL(strSQL) If dsRoles.Tables.Count > 0 Then For Each row As DataRow In dsRoles.Tables(0).Rows
So, what's the difference? Permissions?
I had a version of this code working on 8.10.0, before moving to 8.11.1, but I was accessing the table using more code before discovering the more direct access through g_RulesData.ExecuteSQL(strSQL). I can't be sure this worked in 8.10.0, and I uninstalled all old versions while getting the thin client running.
Since "Users" means something to SQL Server, try changing your query to use:
so that SQL Server knows that you are referring to the table.