You are getting the error not because of what it returns, but what you are sending it. As far as I can see, you haven't Dim'ed Login so it becomes a Variant, and I assume that SqlSetLUser is expecting a string.

------------------
Marty