Topic
  • 2 replies
  • Latest Post - ‏2013-09-12T11:12:29Z by G.Andrejczuk
G.Andrejczuk
G.Andrejczuk
5 Posts

Pinned topic Problem while connecting from windows client to linux Informix database

‏2013-09-09T09:43:54Z |

Hi,

I have following problem while connecting from windows .net client to linux hosted informix database.

Do you know what is causing the error and how to fix it ?

 

I use following code:

        private void button1_Click(object sender, EventArgs e)
        {
            string conn = "";
            try
            {             
                //System.Environment.SetEnvironmentVariable("DB_LOCALE", "pl_pl.Mazovia");
                //System.Environment.SetEnvironmentVariable("CLIENT_LOCALE", "pl_pl.8859-2");
                System.Environment.SetEnvironmentVariable("DB2CODEPAGE", "1208");
                var connectionBuilder = new DB2ConnectionStringBuilder();
                connectionBuilder.Database = @"db";
                connectionBuilder.Server = @"172.17.1.28:25200";
                connectionBuilder.UserID = @"user";
                connectionBuilder.Password = @"pass";
                conn = connectionBuilder.ConnectionString;
                var connection = new DB2Connection(conn);

                connection.Open();
            }

            catch (Exception ex)
            {
                textBox1.Text = ex.Message;
            }
        }

Occasionaly when I mess up with DB2CODEPAGE I get error SQL1159 reason 10.

 

testconn output:

C:\Program Files\ibm\IBM DATA SERVER DRIVER\bin>testconn40.exe "Database=db;User ID=user;Password=pass;Server=172.17.1.28:25200;Persist Security Info=False;"


Step 1: Printing version info
        .NET Framework version: 4.0.30319.2012
        64-bit
        DB2 .NET provider version: 9.7.4.4
        DB2 .NET file version: 10.5.1.4
        Capability bits: ALLDEFINED
        Build: s130816
        Factory for invariant name IBM.Data.DB2 verified
        Elapsed: 0,340034

Step 2: DB2DSDRIVER_CFG_PATH env var: unset
        Validating db2dsdriver.cfg against db2dsdriver.xsd schema file
        C:\ProgramData\IBM\DB2\IBMDBCL1\cfg\db2dsdriver.cfg against C:\Program Files\IBM\IBM DATA SERVER DRIVER\cfg\db2dsdriver.xsd
        Elapsed: 0,0150015

Step 3: Connecting using "Database=db;User ID=user;Password=pass;Server=172.17.1.28:25200;Persist Security Info=False;"
        ERROR [57017] [IBM] SQL0332N  Konwersja znaków ze źródłowej strony kodowej "0" na docelową stronę kodową "1250" nie jest obsługiwana.  SQLSTATE=57017

 

Test failed.

  • Arvind_Gupta
    Arvind_Gupta
    58 Posts

    Re: Problem while connecting from windows client to linux Informix database

    ‏2013-09-11T16:28:20Z  

    Hi,

    If you use DRDA port to connect, you need not to set DB_LOCALE, CLIENT_LOCALE and DB2CODEPAGE environment variables.

    If this does not solves your problem, I would recommend that you contact your local Tech Support group and open a PMR for this issue.

    Thanks,

    Arvind

  • G.Andrejczuk
    G.Andrejczuk
    5 Posts

    Re: Problem while connecting from windows client to linux Informix database

    ‏2013-09-12T11:12:29Z  

    Thank you for reply.

    Environment variables do not affect the work of the program in any other than mentioned way. Test_connect omits them entirely.

    Some DRDA messages are exchanged before error.

    Do you know how database codepage is transmitted ?