About VS2008 using OracleClient link Oracle database to report an error ocienvcreate failed with a return code of-1, but the error message text is not available

Source: Internet
Author: User
Tags oracleconnection

With vs2008 link Oracle database problem, error ocienvcreate failed, return code is-1, but the error message text is not available, from the internet looking for a long time method, there are two kinds of Oracle client file permissions, and run vs2008 as Administrator, These have been tried no use, check for a long time or did not solve the problem, had to change a way to link Oracle data.
I am using the Odac method to link the Oracle database so that I do not need to install the Oracle client, my operation steps are as follows:
1. from [Url=http://download.oracle.com/otn/other/ole-oo4o/odtwithodac1110621.zip? Authparam=1427792567_926a5eb7e7f7456724673afbdb80c825][/url] Download Install ODAC installation file, because I need to install several DLLs under the file, Download down the file for Odtwithodac1110621.zip compressed file.
2. After unpacking, we have installed Setup.exe. Click Execute, then pop up a DOS interface, wait a few 10 seconds to eject the installation screen. Follow the prompts and click Next to complete the installation. The installation will be slow at 90%.
3. After installation we can find oci.dll,ociw32.dll,orannzentr11,orannzmcs11,orannzsbb11,oraocci11 under the installation path (mine is E:\app\Administrator), Oraociei11,orasql11.dll,orasqlplusic11,sqora32,sqresja, just so many DLLs, one of the most critical DLLs is in (My is E:\app\Administrator\odp.net\ BIN) There are two folders under the path, and you select Oracle.DataAccess.dll for your own. Net Framework.
4. Copy the DLL mentioned above to the path of debug, my ASP. I copied it to the bin directory.
5. Rebuild the solution, write a paragraph using the Oracle.DataAccess.Client way to link Oracle's way to try, whether you can link successfully.
6. I provide an example of my

[Code=csharp] Test example [/code]

public void Connbyoracleclient ()    {        string connstring = @ "User Id=xxxxpassword=xxxx;data source= (DESCRIPTION =")    + "(ADDRESS = (PROTOCOL = TCP) (HOST = XX.xx.xx.xx) (PORT = 1521))"   + "(Connect_data ="     + "(SERVER = Dedicate D) "     +" (service_name = xx) "    +") ";        OracleConnection conn = new OracleConnection (connstring);        Conn. Open ();        String sql = "SELECT * from XX";        OracleCommand comm = new OracleCommand (SQL, conn);        OracleDataReader RDR = Comm. ExecuteReader ();        while (RDR. Read ())        {            string s = rdr. GetString (5);        }


The run succeeded without any errors and exceptions.

About VS2008 using OracleClient link Oracle database to report an error ocienvcreate failed with a return code of-1, but the error message text is not available

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.