My C# progrm works for most users but not for all of them anymore.
For some users the ODBC connection won't open.
It use to work with those user but it has stopped for some reason.
The code is:
const string connectionStr="Dsn=db01;Uid=user1;Pwd=123;"
using (OdbcConnection conn = new OdbcConnection(ConnexonGCMEQ.connString))
{
MessageBox.Show(conn.ConnectionString);
conn.Open();
}
I had a look at the db01 connection in ODBC data source administrator and it's identical. The test connection button also works. In fact annother app uses the same connection and still works fine.
I activated odbc tracing and here is the result(I can't figure out how to make something out of them)
243 1af0-1634 EXIT SQLAllocHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x052CFB50
SQLHANDLE * 0x028E3C34 ( 0x052D1E30)
0243 1af0-1634 ENTER SQLSetConnectAttrW
SQLHDBC 0x052D1E30
SQLINTEGER 103 <SQL_ATTR_LOGIN_TIMEOUT>
SQLPOINTER 15
SQLINTEGER -5
0243 1af0-1634 EXIT SQLSetConnectAttrW with return code 0 (SQL_SUCCESS)
SQLHDBC 0x052D1E30
SQLINTEGER 103 <SQL_ATTR_LOGIN_TIMEOUT>
SQLPOINTER 15
SQLINTEGER -5
0243 1af0-1634 ENTER SQLDriverConnectW
HDBC 0x052D1E30
HWND 0x00000000
WCHAR * 0x68792430 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x68792430
SWORD -3
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
0243 1af0-1634 EXIT SQLDriverConnectW with return code -1 (SQL_ERROR)
HDBC 0x052D1E30
HWND 0x00000000
WCHAR * 0x68792430 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x68792430
SWORD -3
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
DIAG [08001] [Sybase][ODBC Driver][SQL Anywhere]Erreur de connexion : Une erreur est survenue lors de la tentative de connexion via TCPIP (-832)
For the working user:
0243 2210-3550 EXIT SQLAllocHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x05F627F0
SQLHANDLE * 0x034F6280 ( 0x05F62870)
0243 2210-3550 ENTER SQLSetConnectAttrW
SQLHDBC 0x05F62870
SQLINTEGER 103 <SQL_ATTR_LOGIN_TIMEOUT>
SQLPOINTER 15
SQLINTEGER -5
0243 2210-3550 EXIT SQLSetConnectAttrW with return code 0 (SQL_SUCCESS)
SQLHDBC 0x05F62870
SQLINTEGER 103 <SQL_ATTR_LOGIN_TIMEOUT>
SQLPOINTER 15
SQLINTEGER -5
0243 2210-3550 ENTER SQLDriverConnectW
HDBC 0x05F62870
HWND 0x00000000
WCHAR * 0x5B3B2440 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x5B3B2440
SWORD -3
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
0243 2210-3550 EXIT SQLDriverConnectW with return code 0 (SQL_SUCCESS)
HDBC 0x05F62870
HWND 0x00000000
WCHAR * 0x5B3B2440 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x5B3B2440 <Invalid buffer length!> [-3]
SWORD -3
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
0243 2210-3550 ENTER SQLAllocHandle
SQLSMALLINT 3 <SQL_HANDLE_STMT>
SQLHANDLE 0x05F62870
SQLHANDLE * 0x034FA360
It seems to be related to the user and not the computer. Does the suer need special permission on a folder?
The user also has acces through a database browser with the same connection string.
update: when the app is installed in an other folder(on the same shared drive) the user can run it. What folder acces deos odbc driver need?
User contributions licensed under CC BY-SA 3.0