Hello Every one,
I need a help on vba code for getting data from MSSQL server 2014 to display in FTview SE client version 12 . Thanks.
Please support on this.
I have tried the below code:
Sub ConnectSqlServer()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sConnString As String
' Create the connection string.
sConnString = "Provider=SQLOLEDB;Data Source=DESKTOP-HSKPA00;" & _
"Initial Catalog=MondelezDB;" & _
"Integrated Security=true;"
' Create the Connection and Recordset objects.
Set conn = New ADODB.Connection
' Open the connection and execute.
conn.Open sConnString
Set rs = conn.Execute("Select AVG(val) from dbo.FloatTable where TagIndex=5;")
' Close the recordset
rs.Close
conn.Close
Set conn = Nothing
Set rs = Nothing
End Sub
I need a help on vba code for getting data from MSSQL server 2014 to display in FTview SE client version 12 . Thanks.
Please support on this.
I have tried the below code:
Sub ConnectSqlServer()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sConnString As String
' Create the connection string.
sConnString = "Provider=SQLOLEDB;Data Source=DESKTOP-HSKPA00;" & _
"Initial Catalog=MondelezDB;" & _
"Integrated Security=true;"
' Create the Connection and Recordset objects.
Set conn = New ADODB.Connection
' Open the connection and execute.
conn.Open sConnString
Set rs = conn.Execute("Select AVG(val) from dbo.FloatTable where TagIndex=5;")
' Close the recordset
rs.Close
conn.Close
Set conn = Nothing
Set rs = Nothing
End Sub