Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. #Region "FillListView"
  2. Sub FillListview()
  3. LV.Items.Clear()
  4. myqry = "SELECT AccResult.StudNo,Exercises.ID from AccResult INNER JOIN Exercises ON AccResult.StudNo = Exercises.ID ORDER BY AccResult.FirstName,AccResult.YrandSec Asc;"
  5. mycmd = New OleDbCommand(myqry, con)
  6. con.Open()
  7. mydr = mycmd.ExecuteReader
  8. While mydr.Read
  9. With LV
  10. .Items.Add(mydr("StudNo"))
  11. With .Items(.Items.Count - 1).SubItems
  12. .Add(mydr("CNumber"))
  13. .Add(mydr("FirstName"))
  14. .Add(mydr("LastName"))
  15. .Add(mydr("YrandSec"))
  16. .Add(mydr("Exer1"))
  17. .Add(mydr("Exer2"))
  18. .Add(mydr("Exer3"))
  19. .Add(mydr("Exer4"))
  20. .Add(mydr("Exer5"))
  21. End With
  22. End With
  23. End While
  24. con.Close()
  25. End Sub
  26. #End Region
  27.  
  28. StudNo (PK)
  29. CNumber
  30. FirstName
  31. LastName
  32. YrandSec
  33.  
  34. ID (PK)
  35. StudNo
  36. Exer1
  37. Exer2
  38. Exer3
  39. Exer4
  40. Exer5
  41.  
  42. AccResult INNER JOIN Exercises ON AccResult.StudNo = Exercises.ID
  43.  
  44. AccResult INNER JOIN Exercises ON AccResult.StudNo = Exercises.StudNo
  45.  
  46. myqry = "SELECT AccResult.StudNo,Exercises.ID from AccResult..."
  47.  
  48. myqry = "SELECT * from AccResult..."
  49.  
  50. myqry = "SELECT AccResult.StudNo,Exercises.ID, Exer1, Exer2, Exer3, Exer4, Exer5 from AccResult INNER JOIN Exercises ON AccResult.StudNo = Exercises.ID ORDER BY AccResult.FirstName,AccResult.YrandSec Asc;"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement