Hello. I have MS Access 2013 and I am trying and failing to programmaticall y connect to an sql server. Whenever I open a table (or do anything really) I get the manual connection screen and am able to reconnect manually. (See attached images for detail)
My goal would be to remove this manual connection screen through executing specific vba code at startup.
After research I have come up with the following code
The code appears to execute correctly. However, I continue to get the same manual connection screen before, during (after the .open command and before the .close command), and after.
I'm certain this is something others have had to deal with and while searching I expected to find a solution quite quickly, but I must be getting old. I have not been able to find a solution and have to ask a question. Thank you very much for your time.
My goal would be to remove this manual connection screen through executing specific vba code at startup.
After research I have come up with the following code
Code:
Public Function startup_SQL() Dim openSQL As ADODB.Connection Set openSQL = New ADODB.Connection openSQL.Open "Provider=SQLOLEDB.1;Data Source=LIMSQL01;Initial Catalog=Lab;User ID=XXXXX;Password=######" openSQL.Close End Function
I'm certain this is something others have had to deal with and while searching I expected to find a solution quite quickly, but I must be getting old. I have not been able to find a solution and have to ask a question. Thank you very much for your time.
Comment