J
John
Hi
When I create a dataadpater by dragging the staff table over a form and
modifying the sql then I can use preview data to show the data fine. If, on
the other hand, I try to get the data using the below code then the number
of records returned is zero. What is the problem?
Thanks
Regards
st2 = "SELECT `unique`, name " & _
"FROM staff " & _
"WHERE (inactive = 0) AND (`unique` > 1 OR `unique` = - 2) ORDER BY name"
Debug.Write(st2)
OdbcCmdStaff.CommandText = st2
OdbcCmdStaff.Connection = m_objConnection
OdbcDAStaff.SelectCommand = OdbcCmdStaff
DS.Tables("Staff").Clear()
OdbcDAStaff.Fill(DS)
Debug.Write("Records: " & DS.Tables("Staff").Rows.Count.ToString) ' <==
rows.count come out zero.
When I create a dataadpater by dragging the staff table over a form and
modifying the sql then I can use preview data to show the data fine. If, on
the other hand, I try to get the data using the below code then the number
of records returned is zero. What is the problem?
Thanks
Regards
st2 = "SELECT `unique`, name " & _
"FROM staff " & _
"WHERE (inactive = 0) AND (`unique` > 1 OR `unique` = - 2) ORDER BY name"
Debug.Write(st2)
OdbcCmdStaff.CommandText = st2
OdbcCmdStaff.Connection = m_objConnection
OdbcDAStaff.SelectCommand = OdbcCmdStaff
DS.Tables("Staff").Clear()
OdbcDAStaff.Fill(DS)
Debug.Write("Records: " & DS.Tables("Staff").Rows.Count.ToString) ' <==
rows.count come out zero.