Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DTS Global Variable Type OTHER

Author  Topic 

LogicalCTO
Starting Member

2 Posts

Posted - 2002-10-31 : 18:08:26
I'm having difficulties with DTS. Everytime I declare a global variable as type "other" it automatically changes it to a Variant. I'm trying to set it as type other so that I can load my POP3 ActiveX Mail Client as a global variable. Any suggestions?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-31 : 18:30:36
If you mean to say you want to set a DTS global variable as a COM object, I'm pretty sure you can't do it. Global variables are meant to store values, not object references.

Go to Top of Page

samrat
Yak Posting Veteran

94 Posts

Posted - 2002-10-31 : 18:38:46
G'dday Logical,

DTS interprets Variable type "Other" as "Variant". So what kinda value do you want to store in just variable type. As variant type should be able to handle almost everything.

I would suggest you use the type variant and see how it goes.

Cheers,

Samrat
Go to Top of Page

Tim
Starting Member

392 Posts

Posted - 2002-10-31 : 20:34:56
DTS supports com objects in global variables. From BOL:

You can dynamically create a COM object and store it in a global variable from within an ActiveX script. In the following example, VBScript code is used to create an ADO connection, which can be used by scripts in the package to execute SQL commands and examine ADO recordsets. In this example, a year-to-date sales table containing a Totals field in the pubs database is created:

Function Main()
dim conn
set DTSGlobalVariables("MyConn").value = CreateObject("ADODB.Connection")

set conn = DTSGlobalVariables("MyConn").value
conn.provider="sqloledb"
conn.open "(local)", "sa", ""
conn.DefaultDatabase = "pubs"
conn.execute("Create Table YTDSales (Totals int)")
Main = DTSTaskExecResult_Success
End Function



----
Nancy Davolio: Best looking chick at Northwind 1992-2000

Edited by - tim on 10/31/2002 20:35:26
Go to Top of Page

LogicalCTO
Starting Member

2 Posts

Posted - 2002-10-31 : 21:32:20
Thanks everyone for your help! I got it working as a variant. Turns out there was an issue with some case sensitivity as well with the globals. Thanks again!

Go to Top of Page
   

- Advertisement -