The point of contention seems to be 1. When logged on a computer with AD credentials it works fine. 2. When logged in as a local admininistrator it has an error...

; Execute the query.
$Recordset = $AdoCommand.Execute
If @ERROR=0
; $Recordset is 1 based
...
Else
? @ERROR
EndIf
EndFunction

And that is where it is failing. At the .Execute.

I know your are out of the office and it is a Friday, but I do appreciate your interest.