Mega Code Archive

 
Categories / Delphi / ADO Database
 

Simplify ADO application deployment

Title: Simplify ADO application deployment Question: When deploying ADO apps, what's the best way to build the ADO Connectstring Answer: When deploying applications that use ADO connections, the developer needs to somehow set the ADO Connection string in the application. The ADO Connection String is big and ugly. I normally store the ADO Connection String in a registry entry. But, if I ever need to create a new ADO Connection string, it's a pain. My old method was the run Delphi, and from inside the IDE, run the ADO Connect string property editor. It presents a neat wizard that makes editing the ADO string easy. I always wished I could have that dialog inside my ADO apps. Well, it turns out that it's AMAZINGLY SIMPLE to do that. First, in the uses statement, include the unit AdoConEd. Then, in your application, add this code to the event that you wish to have trigger the ADO Connect String dialog box: ADOConnection1.Close; // calling EditConnectionString displays the dialog, and // sets the ConnectString property to the resulting value. if EditConnectionString(ADOConnection1) then begin //display the resulting ADO Connect String, just for fun. label11.caption := ADOConnection1.ConnectionString; end; And that is it. Nothing else to it. Now your application can include this powerful ADO Connection String Dialog.