TakeClass Query

Robert B. Denny (18-Nov-95)
Database View
Used to enroll a student in a class, both by name. This query contains two parameters: [pClass], the the name of the class, and [pName], the name of the student to enroll in that class. Note there are no "join" relationships here. Only the StudentsAndClasses table is being appended-to.
PARAMETERS pClass Text, pName Text;
INSERT INTO StudentsAndClasses ( ClassID, StudentID )
    SELECT DISTINCTROW Classes.ClassID, Students.StudentID
    FROM Students, Classes, StudentsAndClasses
    WHERE ((Classes.ClassName=[pClass]) 
        AND (Students.Name=[pName]));

WebSite Tech Support