Home > Software engineering >  On the user data in the VB script for the AD?
On the user data in the VB script for the AD?

Time:09-22

I grab in VB script AD domain on the user's data, how to solve the following mistakes?
Error 1: line: 212 characters: 2 error: invalid procedure call or parameter code: 800 a0005 source: Microsoft VBScript runtime error

Line 2: wrong: 18 characters: 3 error: there was a error code: 80040 e37 source: Active Directory

Excuse me, where both the cause of the error generally?

O thank you thank you O (studying studying)

CodePudding user response:

This problem is worth studying

CodePudding user response:

Visual Basic Scripting Edition

On the Error statement
Please refer to the
Err object | Exit statement
Requirements
Version 1
Enable or disable the error handler,

On the Error Resume Next
On Error GoTo 0
Description
If in your code is not used On the Error Resume Next statement, what happens to a runtime Error will display an Error message, and at the same time, the implementation of the code has been terminated, but running the code host determines the specific operation, the host can selectively processing all kinds of mistakes, sometimes in some cases, it can be in the wrong place activation script debugger, and in some cases, the host can't notify the user, so the Error is not clear for what had happened, as to how to handle errors depends entirely On the function of the host,

In any special process, as long as where the call stack to enable error handler, the error of generally will not be fatal, if in the course of a local error handler is not enabled, when an error occurs, the control can transfer through the call stack, until I find a process has a fault handler, and where the error handling errors, if in the course of the call stack is not found error handling procedures, are in the wrong place to display error messages, termination code execution at the same time, or by the host to correctly handle errors,

On Error Resume Next will make the program according to the statement to continue after the false statements, or according to a recent call process (the process contains On Error Resume Next statement) of the statement continues to run, this statement can override a runtime Error, continue to execute a program, you can after Error handling routines are established within the process, the call to another process, On the Error Resume Next statement becomes inactive, so, if you want to internal Error in the routine treatment, should be in every call routines that executes On the Error Resume Next statement,

When calls to another process, it is prohibited to use On the Error Resume Next statement, so if you want to embed in the routine Error handler, you need to when each call routines should be performed On the Error Resume Next statement, when exiting a process, the Error handler can return to it in the exit process before entering,

If you have enabled On the Error Resume Next Error handler, can be used On Error GoTo 0 to disable the Error handler,

The following example illustrates how to use On the Error Resume Next statement:

On the Error Resume Next
Err, Raise 6 'cause overflow error,
MsgBox (" Error # "& amp; CStr (Err) Number) & amp; "" & amp; Err. Description)
Err. Clear 'Clear the error,
Requirements
Version 1

Please refer to the
Err object | Exit statement



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

? 2001 Microsoft Corporation. All rights reserved,

CodePudding user response:

In the baidu search the corresponding error code,

CodePudding user response:

But in my code to use On the Error Resume Next On Error GoTo 0, at run time are commented out, and no use!

When I run if added conditions, access to a particular department or create account in one day and there are no mistakes, and when to obtain all the data has just started and there are no errors, run the half of the time error, it is also because the reason you say?

CodePudding user response:

ObjCommand.Com mandTimeout=60

CodePudding user response:

ObjCommand.Com mandTimeout=60, please what is the function of this sentence?

CodePudding user response:

The
reference 3 floor zhao4zhong1 response:
in the baidu search the corresponding error code,

https://www.baidu.com/s? Wd=800 a0005
https://www.baidu.com/s? Wd=80040 e37

CodePudding user response:

These operations, is the need to "authority"?
If there is no authority on the "account" to the domain control of access to data, is or is likely to cause failure can't get the relevant data,

CodePudding user response:

You have a problem that script statements are written?
See you the first picture, the "selected" to that part of the string concatenation operator & amp; As no space, in the front and rear of the
You take a closer look at the code, if there is no space, all add on the space and then try to it,
Note that & amp; Want to have more than one space on either side of the,

Another is the problem of "line", the line if you are not the editor "automatic",
Then according to the syntax of VB/VBS line (or "line continuation") : in "at the end of line" with "es Spaces + underscore" code line,
Also note that the line "disconnect" place, can't be a identifier, such as string the middle place,
Should disconnect from the statements inline "separation", such as an operator on both sides, "a comma", the equality, bracket, etc. These "natural space" where the disconnect,

CodePudding user response:

I have the account, also opened the related permission to read the user information

CodePudding user response:

The
references to the tenth floor zhuimengmm response:
I have the account, also open the permissions related to read user information

I said on the 9 floor of the "code problem"?

CodePudding user response:

Well, this and without Spaces has little to do with that, I read in a certain range is it not make a mistake, take the data on the entire AD run half will go wrong
I add space to try again

CodePudding user response:

refer to 12 floor zhuimengmm reply:
well, has very little to do this and do not add a space, I read in a certain range is it no mistake, take the data on the entire AD run half will go wrong
I add Spaces try again

Has little to do???


That is a "grammar", you also thought has little to do.
Ungrammatical, won't be "explain" correctly, why talk about executed correctly???????

CodePudding user response:

Don't you think it doesn't matter "code" is in line with the grammar, literally "random writing" is the same thing!
As long as one can guess what the code "to", the "script interpreter should can understand the meaning of code"?
  • Related