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.
| 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. |
 |
|
|
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 |
 |
|
|
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_SuccessEnd Function----Nancy Davolio: Best looking chick at Northwind 1992-2000Edited by - tim on 10/31/2002 20:35:26 |
 |
|
|
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! |
 |
|
|
|
|
|