Microsoft oledb provider for oracle is not working for Oracle 19c - oledb

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.

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;

Related

Cannot connect to Sql Server from Visual Studio (in the process of creating a new Entity Data Model): login failed for user 'sa'

I know there are similar questions, but I have a specific problem.
Microsoft Visual Studio (2017) pops up this error when I try to create a DB connection for my Entity Data Model
The attempt to attach to the database failed with the following
information: Login failed for user 'sa'.
What I've already checked:
1) The sa user's password hasn't expired or isn't different than what I have specified.
2) The sa user has not been disabled, either by being denied permission to connect to the database engine nor having the login disabled.
3) My instance of SQL Server 2016 (Developer Edition) is configured for SQL authentication.
4) SQL Server is running and I also can connect to it by SQL Server Management Studio (v17.1) via sa and Windows Authentication as well.
What the problem could be?
UPDATE:
I tried to create a DB connection, when adding ADO.NET Entity Data Model -> EF Designer from database -> New Connection -> Microsoft SQL Server Database File (the SchoolDB.mdf wasn't attached to SQL Server... maybe this is the source of the problem)
To be honest, I tried to carry out the same action (make a connection to database (SchoolDB.mdf) and attach the SchoolDB.mdf file to SQL Server), and then Visual Studio gave me a hint:
The database file that you are attempting to connect is not compatible
with the current instance of SQL Server.
Then VS suggested me to upgrade the database file (SchoolDB.mdf).
After I'd done an upgrade of the *.mdf file (that I was trying to attach to SQL Server and make a connection to this DB after that), I could establish a connection to this database (already attached to SQL Server).
Screenshot
PS: I found out that SchoolDB.mdf was created by SQL Server 2012, while I tried to connect it to SQL Server 2016.

My application cannot connect with my database on MsSql express 2005

I have an windows desktop application which uses Mssql2005 express database.
But sometimes, my application cannot connect with the database.
When I run "exec sp_helpdb", my database name is not included in the result list. And when I try to attach my database, server says "database name already exist".
What happened with my database, please help me on this issue!
My application built on .NetFrameWork3.5
Kind Regards
Are you open a connection to the database in your application and you are not closing it?
Try to check the number of your connection with this script, before you are running your app, in the middle and after it got stuck-
SELECT
DB_NAME(dbid) as DBName,
COUNT(dbid) as NumberOfConnections,
loginame as LoginName
FROM
sys.sysprocesses
WHERE
dbid > 0
GROUP BY
dbid, loginame
source

how to connect UNC-located database to embedded server?

I have next specific situation. I have an application using Firebird embedded server. The files: application executive, database, fbembed.dll are located in the same folder. Everything is good and working good.
Now my client says so:
I would like to place all your application file on a server and run it via local network from all workstations.
So as I see I start application on the server and it starts. But database connection string looks now like:
//SERVER/share/db.fdb
Yes, I know conventions about allowed firebird paths from here: FAQ: What's a connection string?
I do not understand what should I use with embedded server? Is it possible at all?
If you want to access a Firebird database over the network, then you need to install Firebird server and connect through the server. You can't (at least not by default) access a database from a network path, and you really shouldn't (although there is a config option to allow it), as it can lead to database corruption due to insufficient or incorrect filelocking support over the network.
So: Don't use Firebird embedded, but install Firebird server and configure the clients to connect to Firebird server.

Delphi XE4 Database connection to Firebird

When using a TIBDatabase to connect to a firebird 1.5 database. When doing it statically from within the XE4 environment it connects fine and can open a table. However if I try and connect dynamically from a running exe, using the same connection params I get a "Username and Password undefined" error. This has surfaced as a new error as previous builds of the same application work fine, but now reverting to the same code causes an error.
Even the most basic of test apps gives the same problem, as soon as it is running as an exe it fails to be able to be connected using the same login and password.
There have been no known changes to the Database engine installation, no OS updates, and environment upgrades.

SQL Server 2008 OLE DB CONNECTION FAILS FROM OUTSIDE

I have a working SQL Server 2008 R2 Express installed on a Windows 2008 server on a cloud machine. All type of connections (ado.net, nhibernate etc.) from several client applications works fine except the OLEDB one. SQL Native Client also works fine.
When I tried to connect from the server locally and as a data source write the instance name, everything was OK. But from outside, I had the problem or also if I write wan ip or dns I had the problem also from local.
-- works perfect from everywhere
Provider=SQLNCLI10;Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx;
-- does not work from anywhere
Provider=SQLOLEDB.1;Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx;
-- works only from local
Provider=SQLOLEDB.1;Data Source=flz001\sqlexpress;User ID=xxx;Password=xxx;
Error: [DBNETLIB][ConnectionOpen (Invalid Instance()).Invalid
connection.
-- works perfect with ado.net
Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx
Some other client applications (not mine) was written with oledb connection so I need them to connect the db with oledb provider.
Any ideas?
Regards,
Mert
It has been a while since this was asked, but I am currently working through an issue related to OLE DB and SQL Server that sounds possibly related.
I found that, even though the server was using the default port (1433), I still had to explicitly specify it in the UDL connection string like this:
Provider=SQLOLEDB.1;User ID=USER;Data Source=IP,1433
I've asked why that might be necessary here:
Why might SQL Server 2008 OLE DB UDL require port 1433 explicitly specified?
Maybe try that and see if it helps.

Resources