简体   繁体   中英

Error: Informix ODBC Driver Network driver cannot open the network device

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 ac# 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM