Solved

Sending login information from client side to App. server

Posted on 2000-04-04
5
200 Views
Last Modified: 2010-04-04
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
0
Comment
Question by:Arabzade
  • 3
5 Comments
 

Expert Comment

by:ShadowFax
ID: 2686609
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
0
 

Accepted Solution

by:
ShadowFax earned 50 total points
ID: 2686697
Sorry Arabzade,
the above was meant to be a proposed answer.

Cheers

Gavin
0
 
LVL 4

Expert Comment

by:Radler
ID: 2702021
listening...
0
 

Author Comment

by:Arabzade
ID: 2703421
Hi ShadowFax

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

  Best Regards
  Arabzade
0
 

Expert Comment

by:ShadowFax
ID: 2746554
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
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question