C# ODBC-Driver Problem Exception SQLSetConnectAttr

0

I have an working c# code to insert some data into a database table with the following code. It works many times without problems but after some inserts I got the exception:

Error: System.Data.Odbc.OdbcException (0x80131937): ERROR [08001] [Simba][SimbaEngine ODBC Driver][DRM File Library]Invalid account name. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed ERROR [01000] [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).

Has anyone an idea how to fix it? Thanks in advance!

My code:

    string connstring = "Driver={Microsoft ODBC for Oracle};" + "Server=xxx;" + "Uid=abc;" + "Pwd=" + retPW + ";";
    System.Data.DataSet dataSet = new System.Data.DataSet();
    try
    {
        using (System.Data.Odbc.OdbcConnection conn = new System.Data.Odbc.OdbcConnection(connstring))
        {

            //Oracle
            string queryString = "INSERT INTO tableA VALUES (dme, status, sysdate, user, sysdate, NULL) ";
            System.Data.Odbc.OdbcDataAdapter adapter = new System.Data.Odbc.OdbcDataAdapter(queryString, conn);

            // Open the connection and fill the DataSet.
            conn.Open();
            adapter.Fill(dataSet);
            conn.Close();
        } 
    }catch (System.Data.Common.DbException ex)
    {

    }
c#
odbc
asked on Stack Overflow Oct 14, 2019 by dankoe • edited Oct 16, 2019 by Pavel Anikhouski

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0