Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying ADO Connection string @ runtime

Status
Not open for further replies.

rizvir

Programmer
Aug 7, 2000
12
TH
Hello,
This might sound very basic but I don't seem to find my way around to modify the ADO connection string at runtime.

The development folder structure is different to the production folder structure. How can I go about modifying ADO connection string at runtime e.g. to point to d:\myapps\delphiapp\data folder instead of c:\develop\data folder.
I am using BDS-2006 and my connection object is in a data module.

Thanks.
Rizwan.

 
Assign the ConnectionString property before opening the connection/dataset.

Example:

Code:
MyConnection.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;' +
                                 'Data Source=' + [b]MyPath[/b] + ';' +
                                 'Persist Security Info=True;';
MyConnection.LoginPrompt :=False;
MyConnection.Connected := True;

buho (A).


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top