SWbemObjectSet generate error wbemErrFailed = 0 x80041001
From: Phil Ten (pt_at_dafweb.com)
Date: 09/04/04
- Next message: chris delaney: "Re: Remote process with network access"
- Previous message: Gary Chang: "Re: LogicalFileSecuritySetting and ACE order"
- Next in thread: Rhett Gong [MSFT]: "RE: SWbemObjectSet generate error wbemErrFailed = 0 x80041001"
- Reply: Rhett Gong [MSFT]: "RE: SWbemObjectSet generate error wbemErrFailed = 0 x80041001"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 4 Sep 2004 12:18:16 +0100
Hello,
I am trying to write a vb script to query a DNS server using WMI.
At first sight my script seem to work fine, but it always fails
when called many times. Typically, the problem will occurs
after 100 to 200 calls. Once the problem occurs the
script will no longer work until stopped and restarted.
At first I suspected a cleanup related issue, but I couldn't
find any information on how to cleanup/release WMI
object. All samples script I view seem to not worry about
cleanup.
The script below generates the problem every times.
'-----------------------------------------------
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
If Err.Number Then Exit Function
Set objService = objLocator.ConnectServer("192.168.0.7",
"root\microsoftdns", "", "")
objService.Security_.impersonationlevel = 3
For i = 1 To 10000
Set objDns = objService.ExecQuery("Select * from
MicrosoftDNS_ResourceRecord where (RecordClass=1) and
(OwnerName='phil237.iispro.net')", , 48)
'!!!!!!!! after 100 to 200 loop the line below generates error
wbemErrFailed = 0 x80041001
For Each objInst In objDns
tmp = objInst.TextRepresentation
Next
Next
'---------------------------------------------------
My configurations:
-Development: Windows Server 2003 Web + MS Access 2002 VBA
-DNS server: Windows 2000 Server + wmi dnsprov
Thank you in advance for all help.
Phil. Ten.
- Next message: chris delaney: "Re: Remote process with network access"
- Previous message: Gary Chang: "Re: LogicalFileSecuritySetting and ACE order"
- Next in thread: Rhett Gong [MSFT]: "RE: SWbemObjectSet generate error wbemErrFailed = 0 x80041001"
- Reply: Rhett Gong [MSFT]: "RE: SWbemObjectSet generate error wbemErrFailed = 0 x80041001"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|