Unable to Connect to SQLSERVER14 Database in VB script connection is not open in Windows Authentific
Function objOpenADODBConnectionToDBSSPI(m_strDBServer, m_strDBName)
'create the ADODB.Connection and Open the connection
Set objConn = CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=SQLOLEDB;Data Source=" & m_strDBServer & ";Initial Catalog=" & m_strDBName & ";Integrated Security=SSPI;"
'Return the Connection Object
Set objOpenADODBConnectionToDBSSPI = objConn
'Reltease memory from the objec
Set objConn = Nothing
Solved! Go to Solution.
If I understand correctly, you are trying to connect to the database using the Windows authentication. I would say that you cannot connect because of the connection string. It seems to be incorrect.
If you need to use the SPI connection, I suppose you need to have a CE device and use the following connection string: https://www.connectionstrings.com/microsoft-data-sqlclient/localdb-named-instance/
If this is a local database, perhaps, the simple connection string like this one (https://www.connectionstrings.com/sqlconnection/trusted-connection-from-a-ce-device/) will be enough.
Customer Care Engineer
Thanks for the information. I found the issue because we were used sqlserver 2012 database now they are upgrade the database so we need to update the sql server driver.
once we are update the driver then its working fine.