i need to add a username and password to my ADODB connection
With cn
.ConnectionString = "DRIVER={SQL Server}; " & _
" SERVER=MyServerName;" & _
" DATABASE=db;" & _
" Trusted_connection=YES"
.Open
End With
i need to add a username and password to my ADODB connection
With cn
.ConnectionString = "DRIVER={SQL Server}; " & _
" SERVER=MyServerName;" & _
" DATABASE=db;" & _
" Trusted_connection=YES"
.Open
End With
This is a good resource to find possible connection strings: https://www.connectionstrings.com/sql-server/
You can try e.g.:
With cn
.ConnectionString = "DRIVER={SQL Server}; " & _
" SERVER=MyServerName;" & _
" DATABASE=db;" & _
" User Id=myUsername;" & _
" Password=myPassword"
.Open
End With