how can i connect to sqlserver 2014 using this connection string and read the table values in Classic ASP.
thanks in advance.
Try
sq = New ADODB.Connection
sq.Open("Provider=SQLOLEDB;Data Source=" & hostdata & ";Initial Catalog=" & db2 & ";uid=" & Usernametxt.Text & ";pwd=" & Passwordtxt.Text & ";Connect Timeout=150;MultipleActiveResultSets=True")
Dim rs As ADODB.Recordset
rs = New ADODB.Recordset
Dim s As String
s = "Select * from Display"
rs.Open(s, sq, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
Using Con As New SqlConnection(conString)
Con.Open()
Using Com As New SqlCommand("Select * from salesmen where salesman = '" & Usernametxt.Text & "'", Con)
Using RDR = Com.ExecuteReader()
If RDR.HasRows Then
Do While RDR.Read
depart = RDR.Item("salesman").ToString()
Loop
End If
End Using
End Using
Con.Close()
End Using