Hi Marvels,
I think you misunderstood my question.
I know how to persist settings, but I don't know how I can retrieve the servername from the ado connection after a user has chosen a server manually after being prompted to do so.
Example:
Code:
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
.Provider = "SQLOLEDB"
' Set to prompt if required.
.Properties("Prompt") = adPromptCompleteRequired
.ConnectionString = "DATA SOURCE=localhost;Integrated Security=SSPI;"
.Open
End With
Now, if the server (localhost) is incorrect the user will be prompted. After the user has chosen a server and the connection is established HOW do I get the server that the connection is established to?
I would have thought the connection string would correlate to the actual connection.
Any ideas?
EDIT!!
I now noted that with the code I posted I actually can read the updated Data Source, but with a DataEnvironment using MSDataShape I cannot...
/EDIT!!
Happy weekend everybody!
Robert