R
Ron
Hello,
I have 4 classes that use 4 DTS packages on 4 different
tables. So I have
Dim cls1 As New clsDTS1, cls2 As New clsDTS2
Dim cls3 As New clsDTS3, cls4 As New clsDTS4
Each class has a common property called DataPath
cls1.DataPath = strPath
I want to use these classes in a loop, so I need to put
them in some kind of array. Obviously I can't use a class
array because they are all different classes. So I tried
using an object array like this:
Dim dts() As Object = {cls1, cls2, cls3, cls4}
For i As Integer = 0 To dts.Length - 1
Ctype(dts(i), dts(i)).DataPath = strPath(i)
....
I had a problem with Ctype(dts(i), dts(i)) where the
compiler said it needed a type for the 2nd dts(i), so I am
kind of in an infinite loop here. Could anyone suggest
what kind of collection object/structure I could use to
loop through the 4 different classes?
Thanks,
Ron
I have 4 classes that use 4 DTS packages on 4 different
tables. So I have
Dim cls1 As New clsDTS1, cls2 As New clsDTS2
Dim cls3 As New clsDTS3, cls4 As New clsDTS4
Each class has a common property called DataPath
cls1.DataPath = strPath
I want to use these classes in a loop, so I need to put
them in some kind of array. Obviously I can't use a class
array because they are all different classes. So I tried
using an object array like this:
Dim dts() As Object = {cls1, cls2, cls3, cls4}
For i As Integer = 0 To dts.Length - 1
Ctype(dts(i), dts(i)).DataPath = strPath(i)
....
I had a problem with Ctype(dts(i), dts(i)) where the
compiler said it needed a type for the 2nd dts(i), so I am
kind of in an infinite loop here. Could anyone suggest
what kind of collection object/structure I could use to
loop through the 4 different classes?
Thanks,
Ron