antvon
Programmer
- Dec 2, 2002
- 45
Hi
I apologise for repeating this question but I posted the
original with an incorrect subject heading.
I need to programmatically change an ado's connectionstring
at runtime.
But I have a problem with the original string in the adocontrol's connectionstring property
ie. ado control's connectionstring set to
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=CompanyX;Data Source=MRX
In my main form's load event I set the control's
connectionstring to
cnnstr =
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=CompanyY;Data Source=MRY
adocontrol.connectionstring = cnnstr
adocontrol.refresh
As soon as the form load event occurs however it tries
to connect to the control's original connection string
and fails to connect.Then the form load event passes the
correct string and it connects fine.
How do I set the connection without connecting to the
original connection?
I apologise for repeating this question but I posted the
original with an incorrect subject heading.
I need to programmatically change an ado's connectionstring
at runtime.
But I have a problem with the original string in the adocontrol's connectionstring property
ie. ado control's connectionstring set to
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=CompanyX;Data Source=MRX
In my main form's load event I set the control's
connectionstring to
cnnstr =
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=CompanyY;Data Source=MRY
adocontrol.connectionstring = cnnstr
adocontrol.refresh
As soon as the form load event occurs however it tries
to connect to the control's original connection string
and fails to connect.Then the form load event passes the
correct string and it connects fine.
How do I set the connection without connecting to the
original connection?