Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having Problem With NULL In an Array. How Do I Check?

Status
Not open for further replies.

djtech2k

MIS
Jul 24, 2003
1,097
0
0
US
I am having trouble reading data out of an array.

I am using a WMI query to pull a directory tree from a remote machine, copy it to another remote machine, and then delete the original.

The problem I have is when reading the directories off of the source with the query using Win32_Subdirectory.

Anyway, it works on one directory, but then it goes to a second location to do the same process on another location and it fails. It is failing trying to read the values from the "colFolders". I get the error message: (NULL)0x80041017.

The line it dies on is "For each subfolder in colFolders". I have added a check with "not isnull" and "not isempty" right before the "for each", but it gets thru and still dies on the "for each".

So I need to know why it is happening and/or how can I test to avoid it? I am assuming that it does not like the data in the array or it is infact null.

Any ideas how to avoid this? I am not ready to just escape the error with a "resume next" because it is critical that I get ALL the data copied to the destination. I cannot skip any of the data.

Any ideas?
 
UPDATE: Since I have been having troubles with the WMI connections in a couple places coming up as null, I have been starting to use FileSystemObject instead in some places. I am now having problems with different things, but am trying to work through.

I will continue more tomorrow morning.
 
you can try this:
if "*" & array_value & "*" = "**" then
array_value_is_null = true
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top