Solved

Sending login information from client side to App. server

Posted on 2000-04-04
5
199 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
Comment Utility
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
Comment Utility
Sorry Arabzade,
the above was meant to be a proposed answer.

Cheers

Gavin
0
 
LVL 4

Expert Comment

by:Radler
Comment Utility
listening...
0
 

Author Comment

by:Arabzade
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now