Link to home
Start Free TrialLog in
Avatar of Arabzade
Arabzade

asked on

Sending login information from client side to App. server

Hi.
 
   I'm working on a 3-tiered client/server project using Delphi 4,
Sql Server 6.5,Dcom.
I'd like to have login prompt on client side ,so that I enabled login
prompt on TREMOTESERVER but i don't know how application server
can verify this information.

   Thanks a lot
Avatar of ShadowFax
ShadowFax

Hi Arabzade,

First of all add a new method to your inteface of your RemoteDataModule in your application server. Set it's invoke kind to Function, set it's return type to WordBool and add two parameters: UserCode and Password. Click refresh of the type library and close it.

Then flesh out the procedure in the RemoteDataModule with something like opening the query with the UserCode/Password parameters and return True to the Result of the Function if the queries IsEmpty or EOF/BOF = False;

Then in you ClientApp Create a small screen at startup/create and force the user to enter his UserCode/Password, then call your new function from your RemoteAppServer like this: DCOMConnection.AppServer.MyFunction(UserCode,Password), if the funtion returns true then run the application, or else terminate(close) it.

HTH

Gavin
ASKER CERTIFIED SOLUTION
Avatar of ShadowFax
ShadowFax

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
listening...
Avatar of Arabzade

ASKER

Hi ShadowFax

   Thanks for the help.
If it's possible for you,write a simple code for
2nd paragraph.

  Best Regards
  Arabzade
Hi Arabzade,

Sure, here goes:

procedure TMyRemoteDM.CheckLogon(StaffNo: Integer; const Password: WideString): WordBool;
begin
  Result := False ;
  if MyQuery.Active then
    MyQuery.Close ;
  MyQuery.ParamByName('StaffNo').AsInteger := StaffNo ;
  MyQuery.ParamByName('Password').AsString := Password ;
  MyQuery.Open ;
  if not MyQuery.IsEmpty then
    Result := True ;
end;

If you've got any further questions just let me know.

Glad to help.

Gavin