I have a .net App I have been asked to modify, it uses .net framework 2.0
I have setup an ODBC DSN with the connection details for our Oracle DB on my local machine, Tested the connection and it works fine.
Now I ran my application, it went with no problem and finished, I had checked our error log and found a couple of errors unrelated to this issue but this error did not show up.
So I ran the app again with break points in order to get to these errors. This time it crashed with the below error
ERROR [IM004] [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed
Now what is getting me on this is that it just ran fine not even 10 minutes ago and I only added a break point.
I have found a few answers and gave them all a shot.
- I set the Read/Execute on the oracle driver folder off than on to reset the permissions and it made no difference
- I checked the "Path" Environment Variable and it is fine
- Using the ODBC Administrator I tested the connection without error.
- Verified the connection string pointing to the DSN is still correct 5. List item
- Verified my App is setup to run 32 bit as the Driver is 32 bit.
The only thing I have not done is to save, shut restart computer and try again.. Which I will do right after this post, if it works I will post that.
Anyway if anyone has any idea what could cause this behaviour I would be very thankful to you.
Computer is Win7, .net FrameWork is 2.0 , it's VB.net, Oracle Driver is 10g (10.2)
Update: okay I used the ODBC Administrator to remove the DSN and rebuild it. I ran my app and it worked.
I came back later today after no changes and re-ran the application and got the error again. tried to rebuild the DSN and it didn't help, I tried to restart and it didn't help.
Below is the stack trace.
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()