views:

864

answers:

2

The below code works in Delphi 2007, but it gives me this error in Delphi 2010:

---------------------------
Error
---------------------------
Cannot load oci.dll library (error code 127).  The oci.dll library may be missing from the system path or you may have an incompatible version of the library installed.
---------------------------
OK   Details >>   
---------------------------

The exception is raised when I set "connected" to "true".

I have tried placing a copy of "oci.dll" in the same folder as the .exe file, but I get the same message.

I also get this message when using the form designer and a visible TSQLConnection component.

Any thoughts?

function TDBExpressConnector.GetConnection(username, password, servername: string) : TSQLConnection;
begin
  //take a username, password, and server
  //return a connected TSQLConnection
  try
    FSqlDB := TSQLConnection.Create(nil);
    with FSqlDB do begin
      Connected := False;
      DriverName := 'Oracle';
      GetDriverFunc := 'getSQLDriverORACLE';
      KeepConnection := True;
      LibraryName := 'dbxora30.dll';
      ConnectionName := 'OracleConnection';;

      Params.Clear;
      Params.Add('DriverName=Oracle');
      Params.Add('DataBase=' + servername);
      Params.Add('User_Name=' + username);
      Params.Add('Password=' + password);
      Params.Add('RowsetSize=20');
      Params.Add('BlobSize=-1');
      Params.Add('ErrorResourceFile=');
      Params.Add('LocaleCode=0000');
      Params.Add('Oracle TransIsolation=ReadCommited');
      Params.Add('OS Authentication=False');
      Params.Add('Multiple Transaction=False');
      Params.Add('Trim Char=False');
      Params.Add('Decimal Separator=.');

      LoginPrompt := False;
      Connected := True;
    end;

    Result := FSqlDB;
  except on e:Exception do
    raise;
  end;  //try-except
end;
A: 

In Delphi 2010 the dbExpress driver for Oracle is dbxora.dll. The libraryname in your named connection says dbxora30.dll. Good chance it will work with the correct name!

Erwin
Sadly, it does not make any difference. Thanks though
JosephStyons
A: 

I got the same sort of message when trying to connect to a informix database, when I set connected to true in design time

astrid