Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread ODBC v.3 connection open error
Mon, Oct 26 2009 4:07 PMPermanent Link

kubi
Hi Chris,
I successfully installed ODBC v3.5. I can use it from Excel with no problem.

But when I connect in C# like
   OdbcConnection cn = new OdbcConnection(@"DSN=MyDsnName;DRIVER={DBIsam3};");
   cn.Open();

I get the following exception:


System.Data.Odbc.OdbcException was unhandled
 Message=""
 Source=""
 ErrorCode=-2146232009
 StackTrace:
      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, Object poolGroupProviderInfo, DbConnectionPool pool,
DbConnection owningObject)
      at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
      at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
      at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
      at System.Data.Odbc.OdbcConnection.Open()
      at Test1.Program.Main(String[] args) in D:\Users\khusmeno\Business\Other\dbIsamTest\Test1\Test1\Program.cs:line 37
      at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
      at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
      at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
      at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
      at System.Threading.ThreadHelper.ThreadStart()

Can you help?
thanks
Tue, Oct 27 2009 7:24 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Kubi,

<< But when I connect in C# like
   OdbcConnection cn = new
OdbcConnection(@"DSN=MyDsnName;DRIVER={DBIsam3};");
   cn.Open();

I get the following exception: >>

Does this happen if the DSN is pointing to an empty database directory with
no table files in it ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Image