Jitendra Shekhawat

Jitendra Shekhawat

  • NA
  • 1.7k
  • 16.8k

invalid authorization specification sql server 2008R2 in vb6

Feb 16 2017 4:57 AM
Private Sub Command_Click()
Dim MyConnObj As New ADODB.Connection   'ADODB Connection Object
Dim myRecSet As New ADODB.Recordset       'Recordset Object
Dim sqlStr As String                                           ' String variable to store sql command
MyConnObj.Open "Provider = sqloledb;" & "Data Source=JITENDRA-PC\SQLEXPRESS;" & "Initial Catalog=Test;"
sqlStr = "select * from Test"
myRecSet.Open sqlStr, MyConnObj, adOpenKeyset
MsgBox "Total Number of records = " & myRecSet.RecordCount
MyConnObj.Close
End Sub

Answers (7)