cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Connect to SQLSERVER14 Database in VB script connection is not open in Windows Authentific

SOLVED
Highlighted
Contributor

Unable to Connect to SQLSERVER14 Database in VB script connection is not open in Windows Authentific

Function objOpenADODBConnectionToDBSSPI(m_strDBServer, m_strDBName)

'Declare Variables
Dim objConn

'create the ADODB.Connection and Open the connection
Set objConn = CreateObject("ADODB.Connection")

'Connection String

objConn.ConnectionString = "Provider=SQLOLEDB;Data Source=" & m_strDBServer & ";Initial Catalog=" & m_strDBName & ";Integrated Security=SSPI;"

objConn.Open

'Return the Connection Object
Set objOpenADODBConnectionToDBSSPI = objConn

'Reltease memory from the objec
Set objConn = Nothing

End Function

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Unable to Connect to SQLSERVER14 Database in VB script connection is not open in Windows Authent

Hi ,

 

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. 

 

Regards,
Yuriy Peshekhonov
Customer Care Engineer

View solution in original post

2 REPLIES 2
Highlighted

Re: Unable to Connect to SQLSERVER14 Database in VB script connection is not open in Windows Authent

Hi ,

 

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. 

 

Regards,
Yuriy Peshekhonov
Customer Care Engineer

View solution in original post

Highlighted
Contributor

Re: Unable to Connect to SQLSERVER14 Database in VB script connection is not open in Windows Authent

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.

https://docs.microsoft.com/en-us/archive/blogs/sqlreleaseservices/released-microsoft-ole-db-driver-f...

once we are update the driver then its working fine.

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!
Top Kudoed Authors