0
votes

I have a serious issue with my ODBC Connection to an Informix DB. Trying to connect to the DB leads straight to the following Error and OdbcException.

[HY000] [Informix][Informix ODBC Driver][Informix]Network driver cannot open the network device. (-25574)

This error only appears trying to connect with a c# program. The Connectionstring is

Driver={IBM INFORMIX ODBC DRIVER};Host=xxx;Server=xxx;Service=xxx;Protocol=xxx;Database=xxx;UID=xxx;PWD=xxx

The string has to be ok because its working on my colleagues pc. I've installed the x86 and the x64 bit driver for informix.

The logfile of the odbc connections brings the following error:

dta_302.vshost  10a0-18dc   ENTER SQLDriverConnectW 
        HDBC                0x08428B20
        HWND                0x00000000
        WCHAR *             0x6F048B34 [      -3] "******\ 0"
        SWORD                       -3 
        WCHAR *             0x6F048B34 
        SWORD                       -3 
        SWORD *             0x00000000
        UWORD                        0 <SQL_DRIVER_NOPROMPT>

dta_302.vshost  10a0-18dc   EXIT  SQLDriverConnectW  with return code -1 (SQL_ERROR)
        HDBC                0x08428B20
        HWND                0x00000000
        WCHAR *             0x6F048B34 [      -3] "******\ 0"
        SWORD                       -3 
        WCHAR *             0x6F048B34 
        SWORD                       -3 
        SWORD *             0x00000000
        UWORD                        0 <SQL_DRIVER_NOPROMPT>

        DIAG [HY000] [Informix][Informix ODBC Driver][Informix]Network driver cannot open the network device. (-25574) 

        DIAG [HY000] [Informix][Informix ODBC Driver][Informix]Network driver cannot open the network device. (-25574) 

This is the first error in the logfile and this error comes up as ODBC exception. There are some more errors in the log. It looks like they are because of the first error.

Until now i have uninstalled and installed the drivers several times with no effect. I've reinstalled Visual Studio. I've also changed some permissions of some registry keys told here ERROR : [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

The very strange thing is if i add the Informix DB to Visual Studio there is obviously no issue and i can use the connection. A test to the logfile shows that there is the same error as well. It seems it was ignored. Same effect if i use the Adoexplorer to connect. It connects and i can work but the error still comes up to the log. My OS is Windows 7 x64. As i said the same configuration is working fine on my colleagues pc.

I've no idea what else to do now. I would be very thankful if anyone could help me.

Edit: I've to correct me. It seems the Error only appears using the Connection String in the C# Code. There is no Error in the Logfile using the AdoExplorer or connect Database from Visual Studio.

1
What happens when you add such connection to DSN in ODBC using odbcad32.exe? In "Connection" tab there is "Apply & Test Connection" button. For Win x64 there is separate odbcad32.exe for 64 and 32 bit applications. The later is in [WinDir]\SysWOW64\odbcad32.exe.Michał Niklas
It works. The connection was successfulChristoph
If your company has active support, I suggest you open a PMR at IBM Support. I already advance, will be annoying work on this problem with them. Because of the difficulty of simulating it.ceinmart
In ConnectionString you use driver, host etc. Can you define DSN and use it from your application? If "Apply & Test Connection" works it should work too.Michał Niklas
Ok, i've created a DSN and "Apply & Test Connection" works. Unfortunately there is still an ODBC Error. ERROR [IM002] [Informix][Informix ODBC Driver]Data source name not found and no default driver specified.Christoph

1 Answers

1
votes

I've finally solved this problem!

In my case my programs are saved on a network directory which is connected to my pc. I've copied the exe file on my C: an it works.

So the problem must have been that i can't run a program via a network directory. Knowing this the error message "cannot open the network device" makes sense. I think normally it had to work as well but for now i am happy with it :)

Thanks for your help.

Edit: using the x86 driver