Solved

Oracle ODBC connection in .NET application

Posted on 2013-01-25
5
1,504 Views
Last Modified: 2013-02-04
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
0
Comment
Question by:lva6600311
  • 3
5 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 38820179
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38820526
>>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
 

Author Comment

by:lva6600311
ID: 38820609
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
 

Accepted Solution

by:
lva6600311 earned 0 total points
ID: 38836849
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
 

Author Closing Comment

by:lva6600311
ID: 38850481
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

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Via a live example, show how to take different types of Oracle backups using RMAN.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now