locked
Oracle Connection Error - System.AccessViolationException: Attempted to read or write protected memory RRS feed

  • Question

  • User-933735073 posted

    Hi,

    I am stuck with Oracle Connection. I am able to connect to Remote Oracel database by using ORACLE SQL DEVELOPER Software with the following connection properties

    Dim strcon As String = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ABCDEFGH)(PORT=myPort)))(CONNECT_DATA=(SERVICE_NAME=myServiceName)));User Id=userID;Password=myPassword;"

    But through VB.Net, an error is coming telling - Oracle ErrorData provider internal error(-3000) [System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    Requesting Experts to advicse on what could be the solution for the same. The thing is that, if i am able to connect to the DB using Oracle SQL Developer then why the same connection property is giving error with VB.net. I am not getting any idea from internet as well. Plz help

    Thanks...

    Monday, August 6, 2012 1:58 AM

Answers

  • User-933735073 posted

    Solved....

    Instead of using OracleConnection, I used OleDBConnection and that's done. The format is as under -

    Dim conn As OleDbConnection = New OleDbConnection
    Dim oradb As String = "Provider=MSDAORA.1;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=yourHOSTName)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=sks2)(SID=sks2)));User Id=hello;Password=hello;"
    conn.ConnectionString = oradb
    conn.Open()

    Thanks all for Suggections...
     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 7, 2012 1:50 AM

All replies

  • User635950694 posted

    Try this

    There is a problem with the 11.2.0.2.1 installer where if another process is locking OCI.DLL during the install, we proceed silently and don't report the error.
    As a side effect we leave an OCI.DLL in <oracle_home>/bin which is the wrong location and this causes crashes.

    One workaround is to create a new Oracle home instead of reusing an old one.

    Or, if you need to install into an existing Oracle home, you can try this to fix the problem:

    After installing 11.2.0.2.1:

    1) Go to the <Oracle home>/bin where 11.2.0.2.1 is installed, (eg \product\11.2.0\client_1\bin) and you should see an OCI.DLL. Delete this file. Please note that there will be another OCI.DLL one directory above "bin". Don't delete that one!
    2) If you cannot delete it, rename it to oci.delete, reboot and then go back and delete it.
    3) Test your application to make sure it works now

    Please let me know if this fixes your problem.
    Monday, August 6, 2012 2:54 AM
  • User-578610739 posted

    Hi Sumit,

    please check below link.

    https://kr.forums.oracle.com/forums/thread.jspa?threadID=2152445

    https://forums.oracle.com/forums/thread.jspa?messageID=10301619

    https://cn.forums.oracle.com/forums/thread.jspa?threadID=415053

    Monday, August 6, 2012 3:06 AM
  • User-933735073 posted

    Thanks for the answers. it seems some internal problem. Nothing worked yet.. still getting same error. I have now requested for upgrade to oracle 11 since i m using win 7. Lets see what's next.

    Thanks again

     

    Tuesday, August 7, 2012 12:20 AM
  • User-933735073 posted

    Solved....

    Instead of using OracleConnection, I used OleDBConnection and that's done. The format is as under -

    Dim conn As OleDbConnection = New OleDbConnection
    Dim oradb As String = "Provider=MSDAORA.1;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=yourHOSTName)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=sks2)(SID=sks2)));User Id=hello;Password=hello;"
    conn.ConnectionString = oradb
    conn.Open()

    Thanks all for Suggections...
     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 7, 2012 1:50 AM