C# connect Progress Database Error

0

I want to connect progress database in local with c#.

my c# code is:

 string connectionString = "DSN=OpenEdge Wire Protocol;Host = localhost; DB = E:\\programs\\DBs\\TrDB\\trnakdb; UID = connuser; PWD = 123456; PORT = 11112";
        DataTable dt = new DataTable();
        int rows;

        using (OdbcConnection connection = new OdbcConnection(connectionString))
        using (OdbcCommand command = connection.CreateCommand())
        using (OdbcDataAdapter adapter = new OdbcDataAdapter(command))
        {
            connection.Open();
            command.CommandText = "SELECT * FROM PUB.FTTEFBAS";
            rows = adapter.Fill(dt);
        }

        Console.WriteLine("adapter.Fill() returned {0}", rows);
        Console.WriteLine("The data table contains {0} rows and {1} columns.",
          dt.Rows.Count,
          dt.Columns.Count
          );
        foreach (DataRow dataRow in dt.Rows)
        {
            string babili = dataRow.ItemArray.ToString()+"####";
            for (int key = 0; key < dataRow.ItemArray.Length; ++key)
                babili += "\t" + key + "=>" + dataRow.ItemArray[key];

            Console.WriteLine(babili);
        }

But it gives error:

System.Data.Odbc.OdbcException (0x80131937): ERROR [HY000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Access denied (Authorisation failed) (7512)

I can connect with progress data dictinary or data administration tools with this username.

If I try select system tables, no errors occur. But when I try to list any table from PUB schema, it gives error.

Thanks

M. Yasin Birer

c#
database
odbc
openedge
progress-db
asked on Stack Overflow Dec 8, 2015 by MyBirer • edited Dec 8, 2015 by Tom Bascom

1 Answer

1

The DBA needs to grant SQL permissions to your userid. The dictionary etc use 4GL permissions which, by default, are wide open. SQL grants are, by default, restrictive.

If you know the DBA userid (often "sysprogress") and password you could try that to prove out your connectivity. And grant perms to users as needed.

You may find this kbase helpful: http://knowledgebase.progress.com/articles/Article/20143/p

answered on Stack Overflow Dec 8, 2015 by Tom Bascom • edited Dec 8, 2015 by Tom Bascom

User contributions licensed under CC BY-SA 3.0