cancel
Showing results for 
Search instead for 
Did you mean: 

Sybase ADO .Net Provider Error Read Access on sysuserperm

Former Member
0 Kudos

Hello,

database user without dba right couldn`t create a datareader via SACommand.

The result is an exception from method _ExcuteReader.

The user needs read Access to sysuserperm!

It looks like a new join on sysuserperm instead of sysuserperms.

Provider before this fix works fine.

================(Build #2147  - Engineering Case #785764)================

When using the .NET GetSchemaTable() method for a query on a table whose

name was not unique, an exception could have occurred in the provider. This

problem has been fixed.

For example, suppose the following query was executed against the table

“employees” owned by DBA, and there also exists a table “Employees” owned

by the user GROUPO.

SACommand cmd = new SACommand("SELECT * FROM DBA.employees", conn);

SADataReader reader = cmd.ExecuteReader();

DataTable schema = reader.GetSchemaTable();

An exception was raised in the GetSchemaTable call. When the tables have

the same letter case, then an exception would not have occurred but the wrong

schema information could have been returned.

best regards

Jörg

Accepted Solutions (1)

Accepted Solutions (1)

former_member207653
Active Participant
0 Kudos

This issue has been fixed in the following SQL Anywhere versions:

17.0.0.1271

16.0.0.2185

12.0.1.4321

as part of CR #790043.

You should download and apply the patches when these are available.

Former Member
0 Kudos

Hello,

thank you for the fast Response.

I am looking Forward to the next Releases.

best regards

Jörg

Answers (1)

Answers (1)

former_member207653
Active Participant
0 Kudos

I have reproduce with SA 16.0.0.2158 on Windows 2012 and assembly 4.5:

SQL Anywhere .NET Data Provider : Permission denied: you do not have permission to select from "sysuserperm" (-121)

I have created two tables with the same name, employees, owned respectively by dba and  myUser who has granted only PUBLIC system role.

The .NET code sufficient to reproduce is below:

conn = new SAConnection(uid=myUser;pwd=sql:server=sa16);

conn.Open();

SACommand cmd = new SACommand("select * from myUser.Employees",conn);

SADataReader reader = cmd.ExecuteReader();

DataTable schema = reader.GetSchemaTable();

We are looking into it.