Thanks for the reply J Ford. I appreciate it. That has happened to me before
also and I didn't even think to try that for this one... turned out to not
be the issue in this case but I appreciate the good advice none the less.
In this case it turns out I'm an idiot (again)
this line:
aDNSServers = Array(PrimaryDNS & "," & SecondaryDNS)
is the problem. Even know I knew the IPs I was supplying were valid I
screwed up making the array. Above produces array with one element
containing a string with both IP's seperated by the comma. Improper use of
the array function. Should be this:
aDNSServers = Array(PrimaryDNS, SecondaryDNS)
and works fine when it is.
"J Ford" <> wrote in message
news:7F2ACC92-FF10-4831-9C19-...
>I have had problems in the past when trying to set something and using a
> specific select statement ie "SELECT MACAddress...", but when I have done
> "SELECT *..." it worked.
>
> -J
>
> "James" wrote:
>
>> uint32 SetDNSServerSearchOrder(
>> [in] string DNSServerSearchOrder[]
>> );
>>
>> above is copy/paste from msdn site on this function. I keep getting error
>> 70, which means invalid IP address but I know the IP's I'm supplying are
>> fine. The site said that it takes a 'list' of ip addresses but fails to
>> mention how that list should be delimited.. I've tried comma and space
>> and
>> 'or' with no luck, same error every time.
>>
>> here is a snippet of my code, including some temp debugging stuff:
>> ----------------------------------
>>
>> Dim temp
>> aDNSServers = Array(PrimaryDNS & "," & SecondaryDNS)
>> For Each temp In aDNSServers
>> MsgBox temp
>> Next
>>
>> sQuery = "SELECT MACAddress FROM Win32_NetworkAdapterConfiguration WHERE
>> IPEnabled = TRUE"
>>
>> set colAdapters = oWMI.ExecQuery(sQuery)
>>
>> For Each oAdapter In colAdapters 'all the NICs in the machine
>> MsgBox "configuring: " & oAdapter.MACAddress
>> iRetVal = oAdapter.SetDNSServerSearchOrder(aDNSServers)
>>
>> If iRetVal = 0 Then
>> msgbox "DNS servers set."
>> Else
>> msgbox "possible error setting dns servers: " & iRetval
>> End If
>> next
>> -------------------------------------
>>
>> aDNSServers contains 2 ipaddresses delimited by a comma. This has been
>> verified with my debugging msgboxs at runtime.
>>
>> what am I missing here?
>>
>>
>>
|