Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Unable to connect to Oracle Database on Windows Server 2012



Permlink Replies: 0
Robert Wehofer

Posts: 1
Registered: 3/23/04
Unable to connect to Oracle Database on Windows Server 2012
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 3, 2015 2:28 PM
Hello all,

I developed a program which connects to an Oracle Database and reads or writes data. This program worked well on Windows XP, Windows Vista, Windows Vista and Windows Server 2008.

The troubles started with Windows Server 2012 (and some people report problems on Windows 8 as well).

If opening the connection to Oracle using the OraOLEDB.Oracle.1 provider, I'll get following possible errors:

Provider cannot be found. It may not be properly installed
or
Data source name not found and no default driver specified

I tried already to install different versions of Oracle Clients: 11, 12 and both in 32bit and 64bit. I reinstalled the Oracle provider for OLE DB, etc. Nothing helped and I have no clue what I can do to solve the problem.

My program is compiled with Delphi XE.

Here is a test sample (Console application):

program OracleConn;

{$APPTYPE CONSOLE}

uses
SysUtils, AdoDB, ComObj, Classes, ActiveX;

var
Conn: AdoDB._Connection;
List: TStringList;
begin
try
WriteLn('Test Oracle Connection');
List := TStringList.Create;
try
List.LoadFromFile('OracleConnString.txt');
if List.Count = 1 then begin
WriteLn('Opening connection with connection string:');
WriteLn(List[0]);
CoInitialize(nil);
Conn := CreateOleObject('ADODB.Connection') as _Connection;
try
Conn.ConnectionString := List[0]; //e.g. Provider = OraOLEDB.Oracle.1; User ID = system; Password = Manager1
Conn.CursorLocation := 3;
Variant(Conn).Open;
WriteLn('Connection opened');
WriteLn('ADO Connection Mode = ' + IntToStr(Conn.Mode));
finally
Conn := nil;
end;
end;
finally
List.Free;
end;
WriteLn('Please press enter ...');
ReadLn;
except
on e: Exception do begin
WriteLn(e.Message);
WriteLn('Please press enter ...');
ReadLn;
end;
end;
end.

Does Delphi XE not support Oracle connections on more modern OS anymore?

Thanks,
Robert

Edited by: Robert Wehofer on Sep 3, 2015 2:29 PM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02