How to acces ADSI-COM-errorcodes? 
Author Message
 How to acces ADSI-COM-errorcodes?

Is it possible to use the errorcodes that are generated by ADSI in
VBScript?
I want to handle error's when binding to ADSI fails
(createobject(WinNT:\\.........).
It's not possible to retrieve them using the errorobject (err.number).
In a 'Microsoft Technet Knowledgebase'-document I found the following:
'All ADSI error codes are returned as COM HRESULT values'.
How can I acces these returned codes?

Thank's in advance,

Geert



Sun, 14 Jul 2002 03:00:00 GMT  
 How to acces ADSI-COM-errorcodes?

Any HRESULT other than S_OK is treated as a runtime error.  The HRESULT is what you should get in VBScript's Err.Number.

ADSI Error Codes
http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm

--
Michael Harris


  Is it possible to use the errorcodes that are generated by ADSI in
  vbscript?
  I want to handle error's when binding to ADSI fails
  (createobject(WinNT:\\.........).
  It's not possible to retrieve them using the errorobject (err.number).
  In a 'Microsoft Technet Knowledgebase'-document I found the following:
  'All ADSI error codes are returned as COM HRESULT values'.
  How can I acces these returned codes?

  Thank's in advance,

  Geert



Sun, 14 Jul 2002 03:00:00 GMT  
 How to acces ADSI-COM-errorcodes?
Then maybe I'm making another mistake.
I will explain my problem with an example.
When I execute following code an WSH-errorbox pop's up and return's the
errorcode '800708AD' (The username could not be found), witch is the
ADSI-code I would like to use.

set objuser = getobject ("WinNT://VTM_NT/xxx,user")

Because of the error the script quit's after displaying the errorbox.
To prevent that I added the statement 'on error resume next', like in
the following example:

on error resume next
set objuser = getobject ("WinNT://VTM_NT/xxx,user")
wscript.echo err.number

The 'err.number' that is displayed in this case is '-2147022675'. This
is not the ADSI-errorcode !?
How can I retrieve this ADSI-errorcode?

Geert

-----Oorspronkelijk bericht-----

Gepost om: woensdag 26 januari 2000 20:06
Gepost naar: vbscript
Discussie: How to acces ADSI-COM-errorcodes?
Onderwerp: Re: How to acces ADSI-COM-errorcodes?

Any HRESULT other than S_OK is treated as a runtime error.  The HRESULT
is what you should get in VBScript's Err.Number.

ADSI Error Codes
http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm
<http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm>

--
Michael Harris





Is it possible to use the errorcodes that are generated by ADSI in
vbscript?
I want to handle error's when binding to ADSI fails
(getobject(WinNT:\\.........).
It's not possible to retrieve them using the errorobject (err.number).
In a 'Microsoft Technet Knowledgebase'-document I found the following:
'All ADSI error codes are returned as COM HRESULT values'.
How can I acces these returned codes?

Thank's in advance,

Geert



Mon, 15 Jul 2002 03:00:00 GMT  
 How to acces ADSI-COM-errorcodes?

wscript.echo hex(err.number)

will give you 800708AD in this case...

In general, you should display any negative err.number in hex format.

--
Michael Harris

  Then maybe I'm making another mistake.
  I will explain my problem with an example.
  When I execute following code an WSH-errorbox pop's up and return's the
  errorcode '800708AD' (The username could not be found), witch is the
  ADSI-code I would like to use.

  set objuser = getobject ("WinNT://VTM_NT/xxx,user")

  Because of the error the script quit's after displaying the errorbox.
  To prevent that I added the statement 'on error resume next', like in
  the following example:

  on error resume next
  set objuser = getobject ("WinNT://VTM_NT/xxx,user")
  wscript.echo err.number

  The 'err.number' that is displayed in this case is '-2147022675'. This
  is not the ADSI-errorcode !?
  How can I retrieve this ADSI-errorcode?

  Geert

  -----Oorspronkelijk bericht-----

  Gepost om: woensdag 26 januari 2000 20:06
  Gepost naar: vbscript
  Discussie: How to acces ADSI-COM-errorcodes?
  Onderwerp: Re: How to acces ADSI-COM-errorcodes?

  Any HRESULT other than S_OK is treated as a runtime error.  The HRESULT
  is what you should get in VBScript's Err.Number.

  ADSI Error Codes
  http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm
  <http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm>

  --
  Michael Harris




  Is it possible to use the errorcodes that are generated by ADSI in
  vbscript?
  I want to handle error's when binding to ADSI fails
  (getobject(WinNT:\\.........).
  It's not possible to retrieve them using the errorobject (err.number).
  In a 'Microsoft Technet Knowledgebase'-document I found the following:
  'All ADSI error codes are returned as COM HRESULT values'.
  How can I acces these returned codes?

  Thank's in advance,

  Geert



Mon, 15 Jul 2002 03:00:00 GMT  
 How to acces ADSI-COM-errorcodes?
Yep, that solved the problem.
Thank you for your effort.

Geert

-----Oorspronkelijk bericht-----

Gepost om: donderdag 27 januari 2000 20:38
Gepost naar: vbscript
Discussie: How to acces ADSI-COM-errorcodes?
Onderwerp: Re: Re:How to acces ADSI-COM-errorcodes?

wscript.echo hex(err.number)

will give you 800708AD in this case...

In general, you should display any negative err.number in hex format.

--
Michael Harris





Then maybe I'm making another mistake.
I will explain my problem with an example.
When I execute following code an WSH-errorbox pop's up and return's the
errorcode '800708AD' (The username could not be found), witch is the
ADSI-code I would like to use.

set objuser = getobject ("WinNT://VTM_NT/xxx,user")

Because of the error the script quit's after displaying the errorbox.
To prevent that I added the statement 'on error resume next', like in
the following example:

on error resume next
set objuser = getobject ("WinNT://VTM_NT/xxx,user")
wscript.echo err.number

The 'err.number' that is displayed in this case is '-2147022675'. This
is not the ADSI-errorcode !?
How can I retrieve this ADSI-errorcode?

Geert

-----Oorspronkelijk bericht-----


Gepost om: woensdag 26 januari 2000 20:06
Gepost naar: vbscript
Discussie: How to acces ADSI-COM-errorcodes?
Onderwerp: Re: How to acces ADSI-COM-errorcodes?

Any HRESULT other than S_OK is treated as a runtime error.  The HRESULT
is what you should get in VBScript's Err.Number.

ADSI Error Codes
http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm
<http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm>
< http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm
<http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm> >

--
Michael Harris








Is it possible to use the errorcodes that are generated by ADSI in
vbscript?
I want to handle error's when binding to ADSI fails
(getobject(WinNT:\\.........).
It's not possible to retrieve them using the errorobject (err.number).
In a 'Microsoft Technet Knowledgebase'-document I found the following:
'All ADSI error codes are returned as COM HRESULT values'.
How can I acces these returned codes?

Thank's in advance,

Geert



Tue, 16 Jul 2002 03:00:00 GMT  
 How to acces ADSI-COM-errorcodes?
Hello Geert,

 I would recommend the "ADSI Resource Kit". It is part of the ADSI SDK and
contains some additional and worthful objects. like the "AdsError".

Set adsErr = CreateObject("ADsError")
On Error Resume Next
Set rec = GetObject("LDAP://DC=ArcadiaBay, DC=Com")
WScript.Echo Err.Number
MsgBox adsErr.GetErrorMessage(Err.Number)

My be that helps.

Best regards,
Manfred Braun

(Private)
Lange Roetterstrasse 7
D68167 Mannheim
Germany


(Remove the anti-spam-underscore to mail me!)



Quote:
> Yep, that solved the problem.
> Thank you for your effort.

> Geert

> -----Oorspronkelijk bericht-----

> Gepost om: donderdag 27 januari 2000 20:38
> Gepost naar: vbscript
> Discussie: How to acces ADSI-COM-errorcodes?
> Onderwerp: Re: Re:How to acces ADSI-COM-errorcodes?

> wscript.echo hex(err.number)

> will give you 800708AD in this case...

> In general, you should display any negative err.number in hex format.

> --
> Michael Harris





> Then maybe I'm making another mistake.
> I will explain my problem with an example.
> When I execute following code an WSH-errorbox pop's up and return's the
> errorcode '800708AD' (The username could not be found), witch is the
> ADSI-code I would like to use.

> set objuser = getobject ("WinNT://VTM_NT/xxx,user")

> Because of the error the script quit's after displaying the errorbox.
> To prevent that I added the statement 'on error resume next', like in
> the following example:

> on error resume next
> set objuser = getobject ("WinNT://VTM_NT/xxx,user")
> wscript.echo err.number

> The 'err.number' that is displayed in this case is '-2147022675'. This
> is not the ADSI-errorcode !?
> How can I retrieve this ADSI-errorcode?

> Geert

> -----Oorspronkelijk bericht-----


> Gepost om: woensdag 26 januari 2000 20:06
> Gepost naar: vbscript
> Discussie: How to acces ADSI-COM-errorcodes?
> Onderwerp: Re: How to acces ADSI-COM-errorcodes?

> Any HRESULT other than S_OK is treated as a runtime error.  The HRESULT
> is what you should get in VBScript's Err.Number.

> ADSI Error Codes
> http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm
> <http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm>
> < http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm
> <http://msdn.microsoft.com/library/psdk/adsi/ds2_error_0t9v.htm> >

> --
> Michael Harris








> Is it possible to use the errorcodes that are generated by ADSI in
> vbscript?
> I want to handle error's when binding to ADSI fails
> (getobject(WinNT:\\.........).
> It's not possible to retrieve them using the errorobject (err.number).
> In a 'Microsoft Technet Knowledgebase'-document I found the following:
> 'All ADSI error codes are returned as COM HRESULT values'.
> How can I acces these returned codes?

> Thank's in advance,

> Geert



Wed, 17 Jul 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Converting errorcodes from COM objects to win32 errorcodes.!!

2. com-port acces

3. Problems with com object : Acces array on index

4. com+ acces time

5. VB, ASP, COM or ADSI Problem????

6. ASP, COM or ADSI Problem????

7. ASP, COM or ADSI Problem????

8. ASP, COM or ADSI Problem????

9. ASP, COM or ADSI Problem????

10. trapping errorcodes

11. Making your own errorcodes ?

12. Errorcodes

 

 
Powered by phpBB® Forum Software