Modified to put all three subjects on same line of output file. Multiple line output was incorrect for PS import.
Added CRLF to line ends (formerly just LF)
Changed line endings to CR. Improved database connection failure handling. Added dialog window alerting to connection problems. Ready for testing.