1
votes

I'm trying to connect to a SQL Anywhere 5 database (I know it's olllld!) with a .NET 3.5 app in WinXP and it works fine from a stand alone console app. But when I run the exact code in a plugin ,running off a separate AppDomain, (the only difference I can tell between the two) with the following code, I get the errors further below.

BTW Both are executed as the SAME user.

           using (OdbcConnection connection =
                new OdbcConnection(strConnect))
            {
                OdbcCommand command = new OdbcCommand(query, connection);
                command.CommandType = CommandType.Text;
                DataTable posRecordsTable = new DataTable();
                connection.Open();

OdbcException Exception returns the following errors:

Index #0 Message: [Sybase][ODBC Driver]Unable to connect to database server: database engine not running

Index #1 Message: [Sybase][ODBC Driver]Invalid connection string attribute

Index #2 Message: [Sybase][ODBC Driver]Invalid connection string attribute

Index #3 Message: [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).

1
So what's the connection string, obfuscate user/password etc. Hard tpo say which bit of it, it might not like, without seeing it.Tony Hopkinson
Tony, the problem is that the exact same connection string and code work fine from a stand alone app =((((((((Heckflosse_230
Always a booger that one. Looking at this msdn.microsoft.com/en-us/library/windows/desktop/…, it suggests theres some subtle difference in the app domain configs of the plug in and console. Might be worth dumping your appdomain settings in each one to a file see if you can spot something.Tony Hopkinson

1 Answers

1
votes

Does the driver on your AppDomain have the same configuration as your stand alone box? I think checking the similarity of the environments will help you. Usually such errors are resolved by looking at the config files from where the driver reads its information. Dont know much about SQL Anywhere, but in general, I've come across such issues and I fixed them by altering the connection information or the configuration file.