How can I implement "ALLOW STREAMD CONNECTION" on

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
microbios
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 03.07.2007, 17:07

How can I implement "ALLOW STREAMD CONNECTION" on

Post 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:
gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Post 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 :)
Last edited by gto on 04.07.2007, 00:52, edited 1 time in total.
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
microbios
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 03.07.2007, 17:07

Post 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!
pol
Senior Boarder
Senior Boarder
Posts: 91
Joined: 13.10.2005, 08:19

Post by pol »

Claro que funciona. Faço sempre assim...
gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Post 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 ;)
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
Post Reply