if the query below returns zero rows, then shouldn't the objDR.read = false? The reason I ask this is becasue I know that no rows are being returned but it still goes into the Do while loop?




VB Code:
  1. sqlCmd = "select employee_last_name,employee_first_name,employee_id from pcms.pcms_pcard where employee_work_unit='" & CmbWorkUnit.Text & "' and status_ind='A' order by employee_last_name"
  2.         Dim objCom As New OleDbCommand(sqlCmd, objCon)
  3.         Try
  4.  
  5.             objCon.Open()
  6.             objDR = objCom.ExecuteReader
  7.             Do While objDR.Read = True
  8.                 Me.CmbCards.Items.Add(Trim(objDR("employee_first_name")) & " " & (Trim(objDR("employee_last_name")) & "  " & (Trim(objDR("employee_id")))))
  9.             Loop
  10.             objDR.Close()
  11.         Catch ex As Exception
  12.             MsgBox("Credit Card fill error: " & Err.Description)
  13.         Finally
  14.             objCon.Close()
  15.         End Try