How do I define a connection with ADO

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

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Jay
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 03.03.2006, 03:16
Location: Mexico

How do I define a connection with ADO

Post by Jay »

How do I define a connection with ADO and specify the parameters? I would prefer to specify the parameters without having to actually store the ODBC datasource. This way the machine that connects only has to have the driver installed but not the actual ODBC definition.

Regards
Jay
User avatar
fduenas
Zeos Dev Team
Zeos Dev Team
Posts: 132
Joined: 26.08.2005, 08:12
Location: Cancún

Post by fduenas »

Hola.

Have you tried this?:

1) Select in TZConnection component the ado protocol
2) Click the '...' button in the DataBase property and it will throw the ADO connection wizard.
3) Follow the same steps you do when creating an ADO connection.
4) Once finished, the ADO connection string will be stored in the DataBase property.

NOTE: AS Long As I Know and unless i'm not updated, there is no implementation done to pass parameters to an ADO connection string that will be replaced automatically when connecting. This have to be an implmentation done for you by replacing the user, host and password values by special strings like %USER%, %PASSWORD%, %HOST% and using StringReplace function (for example) to replace them before connect.
Jay
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 03.03.2006, 03:16
Location: Mexico

Post by Jay »

I tried that and selected "Microsoft OLE DB Provider for ODBC Drivers" and on the next page selected "Use conection string" and pressed the <Generate> button and the normal ODBC wizard appeared. However, when I finish defining the ODBC and press the <Accept> button, it does not respond and I can't close the ODBC window in any way. I had to terminade the Delphi IDE so there must be a bug there somewhere.

Anyway, I kind of understand more or less how to define the string even if I have to manually write it. For now I guess I will have to write it directly and test the conection until it works.

It would be convenient if some basic documentation existed on what has to be specified on the diferent TZConnection properties to make a conection for the diferent drivers.

Thanks for your help.

Regards
Jay
User avatar
fduenas
Zeos Dev Team
Zeos Dev Team
Posts: 132
Joined: 26.08.2005, 08:12
Location: Cancún

Post by fduenas »

HI There is an already documentation for the parameters in the TZConnection. Also there is a CHM file. Take a look for the realased zips and find the parameters.html

It tells there what params you can use for each type of protocol
User avatar
fduenas
Zeos Dev Team
Zeos Dev Team
Posts: 132
Joined: 26.08.2005, 08:12
Location: Cancún

Post by fduenas »

Jay wrote:I tried that and selected "Microsoft OLE DB Provider for ODBC Drivers" and on the next page selected "Use conection string" and pressed the <Generate> button and the normal ODBC wizard appeared. However, when I finish defining the ODBC and press the <Accept> button, it does not respond and I can't close the ODBC window in any way. I had to terminade the Delphi IDE so there must be a bug there somewhere.

Anyway, I kind of understand more or less how to define the string even if I have to manually write it. For now I guess I will have to write it directly and test the conection until it works.

It would be convenient if some basic documentation existed on what has to be specified on the diferent TZConnection properties to make a conection for the diferent drivers.

Thanks for your help.

Regards
Jay
Well it seems strange. i don´t have this kind of problems.

Well, There is an already documentation for the parameters in the TZConnection. Also there is a CHM file. Take a look for the realased zips and find the parameters.html

It tells there what params you can use for each type of protocol.

I have attached the old parameters.html file so you can read it. It's a little bit old but it's quite valid to use with ZeosDBO 6.6

BTW You can use User and Password properties of TZConnection to use them in the ADO protocol. it seems it replaces or add the correct strings to the ConnectionString
You do not have the required permissions to view the files attached to this post.
Post Reply