Ok, the problem with $objConn was with calling it as the wrong var name in one of the UDFs. i was using $objConn instead of $ConnDSN which the UDF wanted.