thanks for DIFF patch.
suggest following changes, the "enrol_dbtable" be changed to...
do the same thing as above to "enrol_coursetable"
adding ability to choose "date format" that is in external database for each of the 3, date fields.
adding ability to set "enrol_student_unroll_id_field" (much like local user role field), but option, to either UN-enroll students completely from course, or change there roles to this role in the external database. Plus, there should be another enrol_unenroll_field, for a per course basis. of either un-enrolling or changing role in course.
for rhyme and reasons see http://moodle.org/mod/forum/discuss.php?d=129964 granted i am dealing with oscommerce, but functionality can spill over to multi other third party software with the more advance functionality.