Oracle ODBC connection in .NET application

I am migrating a VB.NET 32 bit application from a 32 bit environment over to a 64 bit Windows 2008 server environment.  I have VS set up on a dev machine in the new environment and have put my application on here and am now trying to get it to work properly.  I use ODBC to connect to Oracle through Oracle 10G Client(or 11G for 64 Bit)

I am having issues with my ODBC connection.  When I change the target platform to X86 in my application, I get an error stating " Driver's SQLAllocHandle on SQL_HANDLE_ENV failed" so I believe I have driver issues.  We do have a driver set up using c:\windows\sysWOW64\odbcad32.exe which I thought if I used X86 it would point to this 32 bit driver but I  am not sure.  We have also set up a 64 bit driver and DSN using c:\windows\system32\odbcad32.exe.  which I thought would get pointed to when target platform is x64.  When I change my platform to x64 it does at least get a connection but I then get an "Arithmetic operation resulted in an overflow." when I do a DataAdapter.fill command.  

I would like to just keep this as an x86 application(platform) and thought this would point it to the sysWOW64 folder for the drvier connection but can't seem to get it working.  I also do not have much experience with drivers and migrating .NET applications to a 64 bit environment.   Any suggestions??    Thanks

Lance

Also, i have checked path variables as well as setting up Global Object.  I am running this app as an administrator on the 64 BIT machine.  Thanks
lva6600311Asked:
Who is Participating?
 
lva6600311Connect With a Mentor Author Commented:
This issue was resolved by uninstalling the 32 bit 10G  and 64 bit 11G drivers and then installing the 32 bit 11G.  We also installed virtually all components where as prior installs only had those compnenets that enabled it to work in a 32 bit environment.  Unfortunately I don't know exactly which extra components of the 32 bit 11G install made it start working as many more were checked off during the latest install.   Thanks to those who provided tips for this issue.
0
 
slightwv (䄆 Netminder) Commented:
>>We do have a driver set up using c:\windows\sysWOW64\odbcad32.exe which I thought if I used X86 it would point to this 32 bit driver but I  am not sure.  We have also set up a 64 bit driver and DSN using c:\windows\system32\odbcad32.exe.  which I thought would get pointed to when target platform is x64.

Correct.  When you use the odbc admin tool, do the connections test OK?

You need both Oracle drivers installed.  Make sure they test before trying to use them in code.

Since you are using .Net, any reason you are wanting to use ODBC?  I strongly encourage you to use ODP.Net.
0
 
lva6600311Author Commented:
Thanks for the replies.

I have tested both 32 bit and 64 bit driver and the test connection is successful in the ODBC Admin tool(s).  
I do have both Oracle drivers installed and can actually connect when I use the 64 bit driver and my app is set to X64.  But it bombs out
The actual Oracle DB is at a vendor site (We connect through Oracle Client) and they use ODBC and don't want ODP for now, although I have inquired about using ODP with them.  

I am checking on possible registry key changes or reinstalling the drivers.
0
 
lva6600311Author Commented:
If initial solutions(Global variables, Path, Admin rights to folder(Read and execute)) do not work when using Oracle Client for connections to Oracle, please try selecting some of the other components that come with the Oracle Universal Install provided with the client as some of these are needed when changing your 32 bit applications from from a 32 bit platform to 64 bit one.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.