dbTalk Databases Forums  

An error when programming DTS in Sybase

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss An error when programming DTS in Sybase in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jason Chen
 
Posts: n/a

Default An error when programming DTS in Sybase - 08-04-2003 , 05:00 AM






Hi, I try to program DTS using .net(C#) and my DBMS is
Sybase 12, my code segment is below:
when I run the app, it gives an exception "A Dll is
absent." but it does not tell what dll is absent.
after I copy the code segment to VB6, it runs well. why?
any one can help me?

using DTS;

private DTS.Package2Class oPackage;
private DTS.Connection oConnection;
private DTS.Task oTask;
private DTS.ExecuteSQLTask2 oCustomTask;

oConnection = oPackage.Connections.New("MSDASQL");
oConnection.ID = 1;
oConnection.DataSource = "dwdata";
oConnection.UserID = "sa";
oConnection.Password = "";

oTask = oPackage.Tasks.New("DTSExecuteSQLTask");
oCustomTask = (ExecuteSQLTask2)oTask.CustomTask;
oCustomTask.Name = "truncate table Task";
oCustomTask.SQLStatement = "truncate table table1";
oCustomTask.ConnectionID = 1;
oPackage.Tasks.Add(oTask);

DTS.DTSTaskExecResult pTaskResult = 0;
oPackage.Tasks.Item(1).Execute(oPackage, null, null, ref
pTaskResult);


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: An error when programming DTS in Sybase - 08-04-2003 , 05:12 AM






The required dlls are here

Redistributing DTS with your program
http://www.sqldts.com/default.aspx?6,105,225,0,1

Because this is COM C# will need to wrap it in Interop.

Gert has a great cookbook for DTS using .NET

http://www.sqldev.net/dts/DotNETCookBook.htm

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"Jason Chen" <icq_power (AT) msn (DOT) com> wrote

Quote:
Hi, I try to program DTS using .net(C#) and my DBMS is
Sybase 12, my code segment is below:
when I run the app, it gives an exception "A Dll is
absent." but it does not tell what dll is absent.
after I copy the code segment to VB6, it runs well. why?
any one can help me?

using DTS;

private DTS.Package2Class oPackage;
private DTS.Connection oConnection;
private DTS.Task oTask;
private DTS.ExecuteSQLTask2 oCustomTask;

oConnection = oPackage.Connections.New("MSDASQL");
oConnection.ID = 1;
oConnection.DataSource = "dwdata";
oConnection.UserID = "sa";
oConnection.Password = "";

oTask = oPackage.Tasks.New("DTSExecuteSQLTask");
oCustomTask = (ExecuteSQLTask2)oTask.CustomTask;
oCustomTask.Name = "truncate table Task";
oCustomTask.SQLStatement = "truncate table table1";
oCustomTask.ConnectionID = 1;
oPackage.Tasks.Add(oTask);

DTS.DTSTaskExecResult pTaskResult = 0;
oPackage.Tasks.Item(1).Execute(oPackage, null, null, ref
pTaskResult);




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.