I am trying to connect to a SQL Server DTS package in VB
I have the following code
Dim oPackage As DTS.Package2
Dim objConnect As DTS.Connection2
Set oPackage = New DTS.Package2
Set objConnect = oPackage.Connections.New("SQLOLEDB"
With objConnect
.ID = 1
.DataSource = "MYSQLSERVER"
.UseTrustedConnection = True
End With
Set oPackage.Connections.Add = objConnect
'Note: I took this example right off
Microsoft's website.
However I'm being told that the ADD method requires
an argument. When I give it the required argument (the
connection object), I'm told that the object doesn't
support this property or method.
Any help would be greatly appreciated.
I have the following code
Dim oPackage As DTS.Package2
Dim objConnect As DTS.Connection2
Set oPackage = New DTS.Package2
Set objConnect = oPackage.Connections.New("SQLOLEDB"
With objConnect
.ID = 1
.DataSource = "MYSQLSERVER"
.UseTrustedConnection = True
End With
Set oPackage.Connections.Add = objConnect
'Note: I took this example right off
Microsoft's website.
However I'm being told that the ADD method requires
an argument. When I give it the required argument (the
connection object), I'm told that the object doesn't
support this property or method.
Any help would be greatly appreciated.