In one of our old vb6 app connection string is as follows:
nk = "Provider=SQLOLEDB;"
nk = nk + "Integrated Security=SSPI;"
nk = nk + "Persist Security Info=False;"
nk = nk + "User ID=sa;"
nk = nk + "Password=******;"
nk = nk + "Initial Catalog=" & db & ";"
nk = nk + "Data Source=" & hn
kon.ConnectionString = nk
kon.Open
If I try to connect with these options it wont work, so I'm interested why these two options:
nk = nk + "Integrated Security=SSPI;"
nk = nk + "Persist Security Info=False;"
are not ignored?
Just to mention that application is connecting to Sql Server 2016 Express on Windows Server 2016 Standard over local network.
your issue is with
Integrated Security=SSPI
It should be set to false (or removed altogether) as you are not using current Windows user Authentication but a standard SQL user-password login.
Out of MSDN documentation:
When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication. Recognized values are true, false, yes, no, and sspi (strongly recommended), which is equivalent to true. If User ID and Password are specified and Integrated Security is set to true, the User ID and Password will be ignored and Integrated Security will be used.