Authentication:=auWindows and prompt

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
RomanVD
Posts: 4
Joined: Sat 01 Jan 2011 17:43

Authentication:=auWindows and prompt

Post by RomanVD » Sun 02 Jan 2011 12:23

When I set
Authentication:=auWindows
for my MSConnection, I don't get prompt dialog to select server and database. What is the way to fix it?
For auServer that is fine.

AndreyZ

Post by AndreyZ » Mon 03 Jan 2011 15:17

Hello,

In the auWindows authentication mode password and user name aren't needed. That's why we don't show the prompt dialog in this mode. To change this behaviour you should inherit you own connection class from the TMSConnection class and override the NeedPrompt method in the following way:

Code: Select all

TMyMSConn = class(TMSConnection)
protected
  function NeedPrompt: Boolean; override;
end;

function TMyCon.NeedPrompt: Boolean;
begin
  Result := LoginPrompt;
end;

Post Reply