Reputation: 325
I am working on a desktop application. Our desktop application supports Oracle DB as well.
To connect to Oracle DB we are using Microsoft oledb provider for oracle. It is working well till i connect to Oracle 12c.
Now when we use Oracle 18C or later version then my application crashes while opening the connection.
Please see the code snippet below :
Dim dtb As ADODB.Connection
Dim conn As String
conn = "Provider=MSDAORA;" & "Data Source=INRT" & ";Password=abc@908" &
";User ID=system"
dtb.open(conn, "system", "abc@908",
ADODB.ConnectOptionEnum.adAsyncConnect)
Here it is throwing an error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." and crashes.
Note : Using Oracle 19c client(32bit) i am able to setup the connection using above details.
Please help me to resolve the problem.
Upvotes: 1
Views: 10627
Reputation: 41
Exception information: Exception type: AccessViolationException Exception message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
MSDAORA is deprecated, Change Provider=MSDAORA to below
Standard Security
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;
Oracle Trusted Connection This one specifies OS authentication to be used when connecting to an Oracle database.
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;OSAuthent=1;
Upvotes: 4