I'm new to Vb6.
I haven't inserted data in my database and when I run the program, an error shows No Value given for one or more required parameters
Here's the code:
Dim list As ListItem, r As Integer
If recset.State = adStateOpen Then recset.Close
recset.Open "SELECT StudentId, LastName, FirstName, MiddleName FROM Students ORDER BY StudentId", rainCon, adOpenStatic, adLockOptimistic
If recset.RecordCount > 1 Then
MsgBox "No Data Found!", vbInformation, ""
Else
ListView1.ListItems.Clear
Do While Not recset.EOF
r = r + 1
Set list = ListView1.ListItems.Add(, , r)
list.SubItems(1) = recset(0).Value
list.SubItems(2) = recset(1).Value
list.SubItems(3) = recset(2).Value
list.SubItems(4) = recset(3).Value
recset.MoveNext
Loop
End If
Then highlights recset.Open part. How to control or fix this error?