I have file which connet to SQL server from Excel VBA , However I get error message in "SQL Server does not exist or access denied"
resolution is described here:
[login to view URL]
nned to implement this in my code
here is my currect conection to the SQL.
------------------------------------------------------------------------------------------
Dim conn As [login to view URL]
Dim rs As [login to view URL]
Dim sConnString As String
Dim s1 As Worksheet
Set s1 = Sheets("Insert_View")
Dim getserial As String
getserial = GetSerialNumber()
Dim status As String
' Create the connection string.
sConnString = "Provider=SQLOLEDB;Data Source=[login to view URL];" & _
"Initial Catalog=SQL2008R2_919755_5010470;" & _
"Uid=SQL2008R2_919755_5010470_user;Pwd=XXXX;"
' "Integrated Security=SSPI;"
' Create the Connection and Recordset objects.
Set conn = New [login to view URL]
Set rs = New [login to view URL]
' Open the connection and execute.
[login to view URL] sConnString....
------------------------------------------------------------------------------------------