ASP.NET MVC to Timberline connection

I am having trouble connecting to timberline from my asp.net mvc 4 application.

MY CODE

String connection = "DSN=Timberline Data Source;Uid=<myusername>;Pwd=<mypassword>;";
OdbcConnection timberlineConnection = new OdbcConnection(connection);
timberlineConnection.Open(); - This is where the error happens

... more code to fill a DataTable

ERROR MESSAGE

ERROR [08001] [Simba][SimbaEngine ODBC Driver][DRM File Library]Invalid account name.
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
ERROR [01000] [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).

My Timberline Driver Version is 13.01.24.80

DSN - 32Bit

Data Source Name: Timberline Data Source

Database Type: Accounting Data Folder

Data Source Options:

Table and Filed Naming: Standard descriptions

Use maximum table segment size

  • 0
    One thing to check is that your ODBC drive is using the 32Bit Admin - check the DSN in your 32Bit ODBC and make sure it has a company selected (connected to)
  • 0 in reply to Bill Kormoski
    I am using 32 bit. Everything works now. This wasn't a configuration issue rather in my Visual Studio when I stop debugging mode, a process, the development server doesn't shut down properly and results in a failed attempt to connect, the second time I launch debuggging. When I do however shut this down from the task manager it then does connect and I am able to query the data. I am assuming this won't be the case once I am in production environment.
  • 0 in reply to Bill Kormoski
    Ok. I fixed the issue by adding this to my code.

    if (timberlineConnection.State != ConnectionState.Open) {
    timberlineConnection.Open();
    }
  • 0 in reply to Jakes
    I published my solution to a Windows 2008 R2 64bit Server, running IIS7.

    I now get this error:

    I installed Timberline on the server as I need to get the Timberline Data Driver. I created a 32bit DSN. Any ideas what this could be?

    ODBC Connection to Timberline Failed! System.Data.Odbc.OdbcException (0x80131937) at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle) at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions) at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.Odbc.OdbcConnection.Open() at WebPortal.Controllers.AddressBookController.Index() in C:\Users\greimer\Documents\Visual Studio 2010\Projects\WebPortal\WebPortal\Controllers\AddressBookController.cs:line 22