What i understand is you want to show data from database to To Datagrid in vb6
If yes then you can try following code
Dim con As New ADODB.Connection
Dim Rs as new adodb.recordset
if con.state = 1 then con.close
Con.Open _
"Provider = sqloledb;" & _
"Data Source=servername;" & _
"Initial Catalog=DatabaseName;" & _
"User ID=username;" & _
"Password=password;"
If RS.State = 1 Then RS.Close
RS.Open "select field1, field2, field3 from YourTable", con, adOpenKeyset, adLockOptimistic
If RS.RecordCount > 0 Then
Set DataGrid1.DataSource = RS
Else
msgbox "Record Not found", vbCritical, "My DataGrid"
end if
Please let me know if you have more query.