Главная страница | назад





Article #21726: Logging in with an incorrect login results in different errors with Oracle 7 and 8

Question:
Why do I get different errors, when I login with an incorrect user name or password, using Oracle 7 vs. Oracle 8.
Answer:
When connecting to Oracle 7, DLL32 in BDE Administrator is normally set to SQLORA32.DLL. When connecting to Oracle using SQLORA32.DLL the connection is made via calling the Oracle OCI function ologon.

When connecting to Oracle 8, DLL32 in BDE Administrator is normally set to SQLORA8.DLL. When connecting to Oracle using SQLORA8.DLL the connection is made via calling the Oracle OCI function OciBegin Session.

The reason SQLORA8.DLL and SQLORA32.DLL raise different errors is because ologon and OciBeginSession generate different errors when an incorrect login is attempted.

If you connecting to an Oracle 8 database, but like the errors that SQLORA32.DLL generates, here is a way to get the most out of SQLORA8.DLL and SQLORA32.DLL.

//Place this code it the location where connecting to the database occurs
var
  DriverParams : TStringList;
begin
  DriverParams := TStringList.Create;
  try
    DriverParams.Add('DLL32=SQLORA32.DLL');
    Session.ModifyDriver('Oracle', DriverParams);
    Database1.Open;
    //if no exception is raised, then close database and reopen with SQLORA8.DLL
    Database1.Close;
    DriverParams.Clear;
    DriverParams.Add('DLL32=SQLORA8.DLL');
    Session.ModifyDriver('Oracle', DriverParams);
    Database1.Open;
  finally
    DriverParams.Free;
  end;
end;

Last Modified: 13-APR-00