13 September, 2006

Building ADO ConnectionString

Last night I was looking for a way of building a ConnectionString for TAdoConnection from Delphi code and having visited section of "Databases" of a Vingrad forum found the solution. It turned out that it could be easily done! All you need to do is just include AdoConEd unit call EditConnectionString function and send TAdoConnection object as a parameter. Further all is simple. A standard window for building a ConnectionString will be shown in which you will do everything as usual.
Thus deploying applications that use ADO connections became much easier!

Code sample:

  if EditConnectionString(DataModule1.adoconPETS) then
mmConnString.Text := DataModule1.adoconPETS.ConnectionString;
end; // if
PS: this post has been written with the help of www.writely.com

No comments: