- The site for all your DTS needs.
"fabian" <fabianbg@navegalia.com> wrote in message
news:eomvCQk8DHA.2392@TK2MSFTNGP11.phx.gbl...
> I've tried with:
> Dim oconn As DTS.Connection
>
>
>
> oconn = pkg.Connections()
>
> oconn.DataSource = "C:\bcp.txt"
>
> oConn = Nothing
>
> but it fires an exception : "The specified casting is not valid"
>
> "fabian" <fabianbg@navegalia.com> escribió en el mensaje
> news:%23hsBjvh8DHA.2576@TK2MSFTNGP11.phx.gbl...
> > sorry, can you give me any example. I'm newbee in this area.
> >
> > "Allan Mitchell" <allan@no-spam.sqldts.com> escribió en el mensaje
> > news:u6mvwzg8DHA.712@tk2msftngp13.phx.gbl...
> > > You can. Look at the Connections collection of the package and find
> your
> > > particular connection name/provider. You can then set the DataSource
> > > property.
> > >
> > >
> > > --
> > >
> > > Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
> > >
www.allisonmitchell.com - Expert SQL Server Consultancy.
> > >
www.SQLDTS.com - The site for all your DTS needs.
> > > I support PASS - the definitive, global community
> > > for SQL Server professionals -
http://www.sqlpass.org > > >
> > >
> > > "fabian" <fabianbg@navegalia.com> wrote in message
> > > news:%230gXPwg8DHA.1356@tk2msftngp13.phx.gbl...
> > > > Hi, I've got a DTS package in SQL, it imports a text file into a
> table.
> > > I'm
> > > > executing the dts from visual basic.net but the name of the file is
> > inside
> > > > the package, so I can't change it. Can I pass the name of file as
> > > parameter?
> > > > the code in visual basic is :
> > > > Dim pkg As DTS.Package
> > > >
> > > > pkg = New DTS.Package
> > > >
> > > > pkg.LoadFromSQLServer(<server>, <user>, <password>, _
> > > >
> > > > DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, _
> > > >
> > > > "", "", "", <package name>, Nothing)
> > > >
> > > > pkg.Execute()
> > > >
> > > >
> > > >
> > > > pkg.UnInitialize()
> > > >
> > > >
> > >
> > >
> >
> >
>
>