Dim sServer,sDataBaseName ,sConn,oConn,oRS Dim sUserName,sPassWord sServer = "test.test.com,1057\testtable\test" sDataBaseName = "DM_dbname" sUserName = "username" sPassWord = "password" 'sConn="provider=sqloledb;data source=" & sServer & ";initial catalog=" & sDataBaseName & ";" sConn="DRIVER={SQL Server};SERVER=" & sServer & ";DATABASE=" & sDataBaseName & ";Encrypt=Yes;" Set oConn = CreateObject("ADODB.Connection") oConn.CommandTimeout = 36000 oConn.Open sConn, sUserName, sPassWord Set FetchData = CreateObject("ADODB.Recordset") FetchData.open "SELECT COUNT (*) FROM [DM_Reports].[dbo].[Preferences]", oconn While Not FetchData.eof msgbox(FetchData.Preferences) FetchData.movenext Wend
Microsoft OLE DB Provider for ODBC Drivers (19, 1) : [Microsoft][ODBC SQL Server Driver][DBNETLIB]SSL Security error ADODB.Recordset (22, 1) : The connection cannot be used to perform this operation. It is either closed or invalid in this context.
ping serveripaddress
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)