Page 1 of 1

How can I implement "ALLOW STREAMD CONNECTION" on

Posted: 03.07.2007, 17:14
by microbios
How can i implement "allow streamd connection" on Zeos 6.6.1 to use INI files? I have a old version 6.5.1 where have a "Streamed Connection" using INI FILES. If the new version don´t need this, please, show me how i use ini files to put some data like "hostname", "username" on TZCONNECTION component.


Thanks for all, and sorry my TERRIBLE english!!!! :D :roll:

Posted: 03.07.2007, 23:14
by gto
Hello there :)
Brasil always growing here !

I've never used that option in past releases, but always used a ini file to fill up hostname, username, password (encrypted, of course) and stuff.

What I do is:

- Always compile with the connection.active = false, or in the newer relases with the DesignConnection true. Well, that's obvious.

- In the main DataModule, declare in uses the unit IniFiles.

- Into the OnCreate event of the main DataModule, write a procedure like this:

Code: Select all

var
   ini: TIniFile;
begin
   ini := TIniFile.Create(ExtractFilePath(Application.ExeName) + '\config.ini');
   try
      Connection.User := ini.ReadString('MySection', 'MyVar', 'DefaultText');
      Connection.Host := ini.ReadString('MySection', 'MyVar', 'DefaultText');
      Connection.Password := Decrypt(ini.ReadString('MySection', 'MyVar', 'DefaultText'));

      (... and so on)

   finally
      ini.free;
   end;
end;
Hope it helps :)

Posted: 03.07.2007, 23:59
by microbios
dear GTO... Thanks for your help... :lol:
Acredito que vai resolver o problema sim. Antes, no próprio site antigo da ZeosLib tinha um artigo dizendo como implementar essa opção diretamente no código fonte do componente TZCONNECTION. Só assim eu consegui. Mas pelo que você disse, parece que vai funcionar sim. Ainda não testei, mas deixo o resultado aqui assim que testar.

Valeu!!!

Thanks, again!

Posted: 04.07.2007, 11:29
by pol
Claro que funciona. Faço sempre assim...

Posted: 04.07.2007, 12:04
by gto
Galera, mantenham o post, ou pelo menos a idéia chave, com uma cópia em inglês, mesmo que seja um inglês ruim como o meu, senão o pessoal não entende e o que poderia ser uma resposta pra muitos fica como sendo uma resposta exclusiva para nós brasileiros ;)

---

Guys, keep the post, or at least the main idea, with a copy in english, event if it's a bad english like mine, otherwise people doesn't understand and what could be a answer for many, stays as a exclusive answer, just for we brasilians ;)