I have an AdoDC in a Dialog and a DataGrid bound to it. The AdoDC has a connection string that points at a specific database, specified at design time.

I need to set the connection string at runtime, before the AdoDC attempts to connect to the database. How can I do that?

(I have tried calling Adodc::SetConnectionString() from the dialog OnInitDialog method, but it's too late. The AdoDC has already connected to the database soecified at design time.)