in reply to Win32::API Help

Just guessing... but have you tried specifying "I" (int) instead of "N" (long) as the return value type (4th parameter)?  (The API docs don't explicitly say what type/size SQLRETURN is (at least it's not immediately evident to me), so I'd just try likely candidates...)