We help IT Professionals succeed at work.

how can I login to an interbase server remotley ?

belcher
belcher asked
on
I have multiple clients, and I wish them all to use the same interbase server / DB. Every time I try to login from a client over a network/internet connection, I have to login manually on the interbase server first. How can I automate this, and still have individual user names and passwords required to access the remote DB. I have read that i need to create an automation object to do this. How and what do I need to create ? (I am using a SocketConnection).
Thanks
Regards
Richard
Comment
Watch Question

Commented:
Database1.Params.Clear;
Database1.Params.Add('USER_NAME='+'SYSDBA');
Database1.Params.Add('PASSWORD='+'masterkey');
Database1.LoginPrompt:=false;

Author

Commented:
Hi Lucika

thanks for the reply. Does this code reside in the application server or on the client ? If on the App Server, where ?
Mohammed NasmanSoftware Developer
CERTIFIED EXPERT

Commented:
I use this code to connect to oracle Database, but I  it will work fine with all the databases

this code be in the client application, before you connect to any table

procedure TForm1.Button1Click(Sender: TObject);
begin
 with Database1 do begin
   Params.Values['USER NAME'] := 'the user name';
   Params.Values['PASSWORD'] := 'the password';
   LoginPrompt := False;
   Connected := True;
 end;
 Table1.open;
end;

Author

Commented:
I'll re-phrase what I am trying to do, it's best shown by the following text. However the code details is what I require....

community.borland.com

Article #15059: Database login for multiple clients

 Question and Answer Database

FAQ59D.txt   Database login for multiple clients
Category   :DCOM/MultiTier/ActiveForm
Platform    :All
Product    :Delphi 3.x  

Question:
Since the middle tier is doing the database access on behalf of
multiple thin clients, do we lose the ability to associate a
particular database user ID with a particular human user?  This
would seem to be a problem if you want to grant different access
rights to different groups of users at the database level.


Answer:
Yes, if you want to use one connection to the database for all
clients.  If you want, you can have the clients login to the
database.  To do this, create an automation method on the
RemoteDataModule that takes the user name and password and use
that to login to the database.  Also, drop a TSession on your
RemoteDataModule and set it's AutoSessionName property to True.

...............

What I need is the details of how to do this ...
Commented:
HI,
The answer you received is correct.
1. First you create RemoteDataModule with interface
IYourRemoteDatModole f.e.
2. You define a method in that interface f.e.
function LoginAndPassword(const L, P: WideString): WordBool;
3. You implement this function to connect to TDataBase
component.
4. Then you use this method to give the clients access
to your database.
Sincerely,
Nestorua.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.