Re: Automating DTS conversion?
- From: Eddie Shipman <mrbaseball34@xxxxxxxxxxxxxxxxx>
- Date: Wed, 29 Mar 2006 10:46:09 -0600
In article <442aa002$1@xxxxxxxxxxxxxxxxxxxxxx>, john@xxxxxxxxxxxx
says...
My simple understanding of DTS is that it is its own API with a convenient
COM interface. I've written regular C++ code that's invoked the API to
bulk load a database.
I started by using the Import/Export wizard and having it generated a VB
file with the DTS driving code. I then translated that into C++.
I would expect that you can import the DTS library using the ActiveX Type
Library import Delphi feature.
Chris, thank you for the direction. Since I've only ever used DTS via the
Microsoft Enterprise manager interface, what should I look for? I've never
imported an ActiveX Type Library into Delphi before so you have to go slow.
<smile>
I'm going to see if I can get it to generate that VB code you mentioned .
I'll also try Googling for something along these lines too.
If you or anyone has a better example, please share!
Thanks again Chris!
Try this:
function ExecDTS(const PackageName: String): Boolean;
var
pVarHost: OleVariant;
EmptyStr: OleVariant;
pkg: OleVariant;
begin
pkg := CreateOLEObject('DTS.Package');
EmptyStr := WideString('');
pkg.LoadFromSQLServer('yourserver',
'userID',
'Password',
0,
EmptyStr,
EmptyStr,
EmptyStr,
WideString(PackageName),
pVarHost);
pkg.FailOnError := True;
for i := 1 to pkg.Steps.Count do
pkg.Steps.Item(i).ExecuteInMainThread := True;
pkg.Execute;
Result := True;
pkg.UnInitialize;
end;
.
- Follow-Ups:
- Re: Automating DTS conversion?
- From: John Friel
- Re: Automating DTS conversion?
- From: John Friel
- Re: Automating DTS conversion?
- References:
- Automating DTS conversion?
- From: John Friel
- Re: Automating DTS conversion?
- From: Chris Trueman
- Re: Automating DTS conversion?
- From: John Friel
- Automating DTS conversion?
- Prev by Date: Re: Inserts so slow using _Connection.Execute
- Next by Date: Re: Error message during a delete operation
- Previous by thread: Re: Automating DTS conversion?
- Next by thread: Re: Automating DTS conversion?
- Index(es):
Relevant Pages
|