Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Oracle Connection String: Error: Driver's SQLAllocHandle on SQL_HANDLE_ENV failed

Posted on 2008-06-20
5
Medium Priority
?
2,090 Views
Last Modified: 2013-12-19
I am getting the following error:
ERROR [IM004] [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed

when trying to connect to an oracle database oracle 9i

I have tried the following connection strings
from web config
<add name="connString"  connectionString="Driver={Microsoft ODBC Driver for Oracle}; Server=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = hostval)(PORT = portval)))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = servicename)));uid=uidval; pwd=pwdval;"></add>

in dal class
Me.objConn = New OdbcConnection()
Me.objConn.ConnectionString = "Dsn=dsnname;" & _
                                              "Uid=uidtext;" & _
                                              "Pwd=pwdtext;"

The connection strings work fine when I debug on local machine, but fail when the application is on the server.

Any ideas?

0
Comment
Question by:Paulconsulting
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 14

Expert Comment

by:ajexpert
ID: 21833734
So are you using DSN or connection string?
Seems you are using DSN which you might have to create it on server.

BTW ODBC driver is very slow.  Why dont you switch to Oracle Driver for .NET?
0
 
LVL 7

Accepted Solution

by:
Dauhee earned 2000 total points
ID: 21837595
how about:

Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server)(PORT=port))(CONNECT_DATA=(SERVICE_NAME=servic)));User ID=user;Password=pass;

yep better to use ODP as it is native to oracle and inherantly faster. You can keep all your interfaces and just change OdbcConnection to OracleConnection

Imports Oracle.DataAccess.Client

So would be:

Me.objConn = New OracleConnection("Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server)(PORT=port))(CONNECT_DATA=(SERVICE_NAME=servic)));User ID=user;Password=pass;")

that way its TNSless and you don't need to go copying tns entries when promoting to different servers
0
 
LVL 7

Expert Comment

by:Dauhee
ID: 22038259
did you have any luck?
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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 …
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

609 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