In this case and that would be for validation, that is looking for students in that course and if you find you could tell the program that allows you to delete. For example, have a student table with cod_student and name_student as fields, and then there are the table with the fields assigned_course_students cod_student and course_student. Then the time to remove any student questions.
Code:
sql = "select * from WHERE assigned_course_Students code_student = '" & txtstudent.text & "'" / / where txtstudent who has the code to remove
dim cmd as new odbc.odbccommand (sql, connection)
dr = cmd.executreader ()
// Valid here
Then if dr.Read
msgbox "This student belongs to a course and cannot be deleted"
else
sql = "delete from assigned_course_Students WHERE code_student = '" & txtstudent.text & "'"
'
'
'
Bookmarks