Re:Sql Server / DTS / Delphi 6
Didn't catch the first question but does this help Only good on single item
dts files.
var
TheDTS,objConnect: Variant;
i:integer;
Begin
TheDTS:= CreateOleObject('DTS.Package');
try
TheDTS.LoadFromStorageFile(ExtractFilePath(ParamStr(0)) +
'\UpdateAM5.dts','');
//TheDTS.GlobalVariables.Item('TheMDB').value:='C:\Program Files\Agency
Manager\Data\amdata.mdb';
for i := 1 to TheDTS.Steps.count do
TheDTS.Steps.Item(i).ExecuteinMainThread := True;
TheDTS.FailOnError := true;
TheDTS.Execute;
except
on E: Exception do
begin
//Display the error message.//
ShowMessage('{*word*81} something went wrong = ' + E.Message);
end;
end;
TheDTS.UnInitialize;
TheDTS:= Unassigned;
ShowMessage('Done');
--
Brian Slack
http://www.depicus.com
"Wake On Lan" and "Remote Shutdown" Software
Quote
"Jerry Nichol" <je...@traxis.ca> wrote in message
news:3dd2c5e6@newsgroups.borland.com...
Quote
> Hi Euan,
> I have the same problem as Lawrence, wanting to run a DTS routine (I have
a
> saved .DTS file, I don't know if he's referring to the same thing) against
a
> SQL Server 2000 DB via Delphi.
> I'm not familiar with xp_cmdshell (or SP_Oa), would I be able to use the
> ShellExecute function (or similar) to call dtsrun with the name of the
.DTS
> file to use? I realize I'm likely totally out to lunch here - I'm hoping a
> more well-informed individual like yourself (or whoever else wants to
reply)
> can provide some helpful advice.
> Thanks!
> Jerry