Can you show us what this returns:

Code:

$EXResult=DBExecuteSQL($SQLCon, $SQLCode,4)

?"Error=" + @SERROR



You'll probably have to put this at the top of your script, so you will be able to see the entire error message:

$= SetOption("WrapAtEol", "On")