Page 1 of 1

How Protect The properties: User Password Database HostName

Posted: 13.03.2009, 16:45
by jamiguel77
hi all, i use Delphi7 and Zeos Components 6.6.1 beta

easy my question: How Protect The properties: User Password Database HostName

sample: suppose i have a form named: FLogin and a Connection named: Zconnection

in form create i have a simple configuration of my Zconnection component:

procedure TFlogin.FormCreate(Sender: TObject);
begin
Zconnection.Hostname:='192.168.0.3';
Zconnection.User:='mydbuser';
Zconnection.Password:='mydbpass';
Zconnection.Database:='mydb';
Zconnection.Connected:=true;
end;
suppose for the rest of my team (5 ppl) i share my Flogin.Dcu they cant see the user and password and hostname and database in design time right ?

but they can know if in any form type something:

Form1.Caption:='User: '+Flogin.Zconnection.User+' Password: '+Flogin.Zconnection.Password+' Hostname: '+Flogin.Zconnection.Hostname+' Database: '+Flogin.Zconnection.Database;

then they know the parameters, my question is: how protect these 4 parameters, and only share the connection?

Thanks

Posted: 17.03.2009, 12:39
by gto
The best method you can go is to encrypt these properties anywhere you want (registry, inifile, config file) and load them at runtime.

Well, sorry for the question, but you're tying to protect the connection details from your team? kinda wired.. Maybe if you use a local server, with a known connection properties, and load the remote (production) lines at runtime, you can do better of both sides.

Posted: 21.03.2009, 00:38
by mdaems
Another solution might be to build a new connection object inheriting from TZConnection. Then you can just set the secret properties at create time and hide those properties.

Mark