[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Oracle ODBC connection in .NET application

Posted on 2013-01-25
5
Medium Priority
?
1,727 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 78

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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses
Course of the Month18 days, 8 hours left to enroll

825 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