I post the same question, and I think I am in ther rihgt forum.
I am struggling with a couple of issues relate to the conversion from VB 6 to VB .NET. Specically it is relate Interface 'DTS.OLEDB Properties' cannot be indexes because it has no default property. I know where the problem is but I do not know how to fixed. The problem in the code is every time :
(oConnection.ConnectionProperties) shows up in the code
Here is the code:
Dim oConnection As DTS.Connection2
oConnection = goPackage.Connections.New("Microsoft.Jet.OLEDB.4.0"
oConnection.ConnectionProperties("Data Source".Value = “C:\UPLOADS.mdb"
oConnection.ConnectionProperties("Mode".Value = 1
oConnection.Name = "Connection 1"
oConnection.ID = 1
oConnection.Reusable = True
oConnection.ConnectImmediate = False
oConnection.DataSource = “C:\UPLOADS.mdb"
oConnection.ConnectionTimeout = 60
oConnection.UseTrustedConnection = False
oConnection.UseDSL = False
goPackage.Connections.Add(oConnection)
oConnection = goPackage.Connections.New("SQLOLEDB"
oConnection.ConnectionProperties("Integrated Security".Value = "SSPI"
oConnection.ConnectionProperties("Persist Security Info".Value = True
oConnection.ConnectionProperties("Initial Catalog".Value = "Test"
oConnection.ConnectionProperties("Data Source".Value = "TestServer"
oConnection.ConnectionProperties("Application Name".Value = "DTS Import/Export Wizard"
oConnection.Name = "Connection 2"
oConnection.ID = 2
oConnection.Reusable = True
oConnection.ConnectImmediate = False
oConnection.DataSource = "TestServer"
oConnection.ConnectionTimeout = 60
oConnection.Catalog = "Test"
oConnection.UseTrustedConnection = True
oConnection.UseDSL = False
goPackage.Connections.Add(oConnection)
thanks
I am struggling with a couple of issues relate to the conversion from VB 6 to VB .NET. Specically it is relate Interface 'DTS.OLEDB Properties' cannot be indexes because it has no default property. I know where the problem is but I do not know how to fixed. The problem in the code is every time :
(oConnection.ConnectionProperties) shows up in the code
Here is the code:
Dim oConnection As DTS.Connection2
oConnection = goPackage.Connections.New("Microsoft.Jet.OLEDB.4.0"
oConnection.ConnectionProperties("Data Source".Value = “C:\UPLOADS.mdb"
oConnection.ConnectionProperties("Mode".Value = 1
oConnection.Name = "Connection 1"
oConnection.ID = 1
oConnection.Reusable = True
oConnection.ConnectImmediate = False
oConnection.DataSource = “C:\UPLOADS.mdb"
oConnection.ConnectionTimeout = 60
oConnection.UseTrustedConnection = False
oConnection.UseDSL = False
goPackage.Connections.Add(oConnection)
oConnection = goPackage.Connections.New("SQLOLEDB"
oConnection.ConnectionProperties("Integrated Security".Value = "SSPI"
oConnection.ConnectionProperties("Persist Security Info".Value = True
oConnection.ConnectionProperties("Initial Catalog".Value = "Test"
oConnection.ConnectionProperties("Data Source".Value = "TestServer"
oConnection.ConnectionProperties("Application Name".Value = "DTS Import/Export Wizard"
oConnection.Name = "Connection 2"
oConnection.ID = 2
oConnection.Reusable = True
oConnection.ConnectImmediate = False
oConnection.DataSource = "TestServer"
oConnection.ConnectionTimeout = 60
oConnection.Catalog = "Test"
oConnection.UseTrustedConnection = True
oConnection.UseDSL = False
goPackage.Connections.Add(oConnection)
thanks