Multiple-step OLE DB operation ERROR

I am trying to Connect SQL Server 2005 from VB6 code. I am getting the below error:

"Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done"

I am using the following code:

option 1

strConnectString = "Provider=SQLOLEDB;" & _
"Server=" & strServerName & "; " & _
"Database=" & strDatabaseName & ";  " & _
"Integrated Security=true"

or

option 2

strConnectString = "driver={SQL Native Client}; " & _
"Data Source=" & strServerName & "; " & _
"Initial Catalog=" & strDatabaseName & ";  " & _
"Integrated Security=true"

in Declaration part

Private madconMine As ADODB.Connection

Set madconMine = adconGetConnection(strConnectString, lngCursorLocation)

Private Function adconGetConnection(ByVal strConnectString As String, _
                                    ByVal lngCursorLocation As ADODB.CursorLocationEnum) _
                                    As ADODB.Connection
   
    Dim adconThis As ADODB.Connection
    Set adconThis = New ADODB.Connection

    With adconThis
        .ConnectionString = strConnectString
        .CursorLocation = adUseClient
        .Open    ' (at this level It giveing error:"Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done")
    End With

    Set adconGetConnection = adconThis
End Function

There was no luck using both options.I am always getting this error. Please advise.

Thanks!

2 answers

This error message is a generic one and can indicate a lot of things.. :(

So the error happens on "Open" right?

Try to change "Integrated Security=true" to "Integrated Security=SSPI;".

Just a wild guess... :)

Thanks.
But I had tried with different option here as per below and works fine for me.

strConnectString = "Provider = SQLNCLI11; " & _
"Server=" & strServerName & "; " & _
"Database=" & strDatabaseName & "; " & _
"Integrated Security=SSPI"