Can someone please help, The DataGrid(grdStaff) is not being populated with the recordset from database. When I move this code to a new
VB project it works.
PS: I already have connection to the database. I am Using ADO
Dim sql As String
Dim r As New ADODB.Recordset
Set r = New ADODB.Recordset
sql = "SELECT Username, Password from Admin"
With r
.Open sql, cnn, adOpenKeyset, adLockOptimistic, adCmdText
Set grdStaff.DataSource = r
End With
End Sub