Re: Automating DTS conversion?



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;

.



Relevant Pages

  • Re: Automating DTS conversion?
    ... I started by using the Import/Export wizard and having it generated a VB ... I would expect that you can import the DTS library using the ActiveX Type ... Library import Delphi feature. ... Microsoft Enterprise manager interface, ...
    (borland.public.delphi.database.ado)
  • Re: Sybase to SQL
    ... Not using the wizard. ... in full which in turn allows you to import/export many tables or it expects ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... www.SQLDTS.com - The site for all your DTS needs. ...
    (microsoft.public.sqlserver.dts)
  • RE: Export Access Data to Peachtree
    ... mimics the format Peachtree uses in its import/export fuction from the File ... from directly writing records into an accounting system as it tends to bypass ... the error checking capabilities that are used in the import/export functions. ... I've been able to interface purchase orders, receipts, invoices, inventory ...
    (microsoft.public.access.developers.toolkitode)
  • Re: "Class not registered" error when opening DTS package...
    ... Importing A Text File Using The DTS Wizard ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... import/export data to/from sql server 2000 and comma delimited files. ... Designer Error when trying to open my packages. ...
    (microsoft.public.sqlserver.dts)
  • DTS: Begginer question
    ... How can I use DTS to import/export tables and objects from a database. ... Do you program the packages for import/export or the UI that executes those ...
    (microsoft.public.sqlserver.programming)