Access UniData via .net

I'm having problems accessing UniData data from the u2.net toolkit. I can connect normally - I checked the connections to the "Test Connection Tool" and in the code, both connections work fine. My problem is that when I try to populate a dataset - using the sample code: I get this error:

[U2][UCINET][UNIDATA]:You have no privilege on file THENAME 

Here is the code:

  U2Connection con = new U2Connection(); try { U2ConnectionStringBuilder conn_str = new U2ConnectionStringBuilder(); conn_str.UserID = "id"; conn_str.Password = "pwd"; conn_str.Server = "srv2"; conn_str.Database = "DB.XXX"; conn_str.ServerType = "UNIDATA"; conn_str.RpcServiceType = "udserver"; con.ConnectionString = conn_str.ToString(); con.Open(); DataTable schema = con.GetSchema(); U2DataAdapter da = new U2DataAdapter("SELECT * FROM THENAME ", con); DataSet ds = new DataSet(); da.Fill(ds); } catch (Exception ex) { string lStr = ex.Message; } finally { con.Close(); 

1 again, I have an ODBC connection setup. Through ODBC, I can use the same credentials inside the linked SQL Server to successfully receive the same query. Any ideas would be appreciated.

+4
source share
2 answers

By default, UniData provides no privileges to access files through SQL.

You will need to run CONVERT.SQL from the database to grant privileges to this file.

You can learn more about the command, either by running HELP CONVERT.SQL on the command line, or by reading the manuals .

+1
source

Could you run the TCL command?

select * from privilege;

Do you see THENAME there? For example, see the attached screenshot for the VOC file.

enter image description here

enter image description here

0
source

Source: https://habr.com/ru/post/1440643/


All Articles