The code that saves a new topic to the database is lines 762-937 of post_info.asp
Look for 2 lines:
Line 798: txtSubject = ChkString(Request.Form("Subject"),"SQLString")
is where the subject from the form is checked for invalid characters
Line 843: strSql = strSql & ", '" & txtSubject & "'"
is where it's written to the database.
Hope that helps.