Trap the error your getting from AddPrinterConnection and report back. Trace it like this:

$Error = AddPrinterConnection(...)

?"ERROR=" + $Error