Click here to Skip to main content
16,016,669 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I get the following error when i try and run the code below agenst another computer remotely.I have full rights over the machine so thats not an issue. I also know if i copy the aservice file to my machine i have not problems with the code but i dont want to have to copy the whole file from every machine i work on.

i get the error:
Cannot convert start value of type 'Integer', limit value of type 'DBNull', and step value of type 'Integer' to a common numeric type.

I get this error at
VB
For i = 0 To StrHeaps Step +1


My Code:

VB
objsh = CreateObject("WScript.Shell")

strObject = "C:\Temp\ASERVICE.EDM"

Dim process = GetObject("winmgmts:\\ADNRFZ900015\root\novadigm:NVD_Agent")
Dim method = process.Methods_("GetValue")
Dim inParameters = method.inParameters.SpawnInstance_()
inParameters.Path = strObject
Dim outParameters = process.ExecMethod_("NumberOfInstances", inParameters)
Dim StrHeaps = (outParameters.InstanceCount)
'num_TextBox = StrHeaps
For i = 0 To StrHeaps Step +1
    inParameters.Index = i

    inParameters.Property = "ZOBJNAME"
    outParameters = process.ExecMethod_("GetValue", inParameters)
    Dim Value1 As String = outParameters.Value

    inParameters.Property = "ZAVIS"
    outParameters = process.ExecMethod_("GetValue", inParameters)
    Dim Value2 As String = outParameters.Value

    inParameters.Property = "NAME"
    outParameters = process.ExecMethod_("GetValue", inParameters)
    Dim Value3 As String = outParameters.Value

    inParameters.Property = "INSTDATE"
    outParameters = process.ExecMethod_("GetValue", inParameters)
    Dim value5 As String = outParameters.Value

    Dim value4 = ListView1.Items.Count
    Dim item As New ListViewItem(value4)
    item.SubItems.Add(Value1)
    item.SubItems.Add(Value2)
    item.SubItems.Add(Value3)
    item.SubItems.Add(value5)
    ListView1.Items.Add(item)
    ListView1.FullRowSelect = True

Next
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900