We help IT Professionals succeed at work.

Connection String  setup...

cacandz
cacandz asked
on
how do i set up Connection String property for ADO?
Comment
Watch Question

Commented:
What kind of database you which to connect to?

You can make it by clicking build button then follow the wizard.
Commented:
This is an example of composing connection string manually at run time:

for MS-SQL:

  AdoConnection1.ConnectionString:= 'Provider=SQLOLEDB.1;Password=' + APassword + ';Persist Security Info=True;User ID=' + AUserName + ';Initial Catalog='  + ADatabaseName + ';Data Source=' + AServerName + ';';

APassword, AuserName, etc are variables can be used to pass password, username and other configuration to the connection.

Commented:
This is an example of connecting to MS-Access database:

'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' +
'ADatabaseName' + ';Persist Security Info=False';

Motaz
If u need setup ado connstr in your program like in delphi:

uses ADOConEd;

...

    ADOConnection1.ConnectionString := Edit1.Text;
    EditConnectionString(ADOConnection1);
    Edit1.Text := ADOConnection1.ConnectionString;
cacandz:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
CERTIFIED EXPERT

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

accept Motaz's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.