----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[email protected]>
Sent: Thursday, May 19, 2005 5:23 PM
Subject: RE: win32::Lanman Error
> Hello Rob,
>
> Actually, I initially thought that because of the volume of the data (it
> fetches around 60k records so) I had an impression that it might take
> some time, but your statement has raised an alarm to me.
>
Sorry - I assumed that because it was a simple script, it would run quickly
.... perhaps that's not the case. I have little experience in this area.
> Also, last night the job failed again but this time I have captured the
> error successfully (hopefully).
>
> if(!Win32::Lanman::NetUserEnum("$PDC", &FILTER_NORMAL_ACCOUNT,
> [EMAIL PROTECTED]))
> {
> print "Sorry, something went wrong; error: ";
> # get the error code
> print Win32::Lanman::GetLastError();
Instead, I would have:
print Win32::Lanman::GetLastError(), " ", Win32::GetLastError(), " ",
Win32::FormatMessage(Win32::GetLastError()), "\n";
If you find that Win32::Lanman::GetLastError() and Win32::GetLastError()
report different numbers, then the formatted message is probably incorrect.
But I expect that Win32::Lanman::GetLastError() and Win32::GetLastError() to
report the same number (in which case the formatted message should be
correct).
> }
>
> Result:
> "Sorry, something went wrong; error: 53"
>
It would be better if you could get the error message as a string, rather
than a number (see my attempt to do that, above). The error codes (and their
meanings) are probably available somewhere on the MS website (among other
places). I have them listed in my Visual Studio documentation so I looked up
53 there. It means that "the network path was not found". Why would that
happen ?
Was that error thrown by NetUserEnum() or by NetGetDCName() ? I expect that
if "the network path was not found" then NetGetDCName(), which gets called
*before* NetUserEnum(), should fail - or does NetGetDCName() not need to
find the network path ?
Cheers,
Rob
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs