I am writing an app in vb6. While developing it, I have been using an ado data
control that has been configured to access a SQL Server database. Everything
works fine. But now, I want to be able to set the connection string at runtime.
I removed the connection string in the properties dialog box for the control and
added the following code to the form containing the control:
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=MyID;Initial Catalog=billing;Data Source=MyServer"
This connection string was cut and paste directly from the adodc's properties
dialog box. But now I get an error message: [Microsoft][ODBC Driver Manager]
Data Source name not found and no default driver specified
Where did I go wrong? How can I set the connection string for this control at
runtime? Thanks in advance for any hints.