dbTalk Databases Forums  

keep FileSystemObject across phases

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


Discuss keep FileSystemObject across phases in the microsoft.public.sqlserver.dts forum.



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

Default keep FileSystemObject across phases - 04-26-2005 , 11:11 AM






I would like to keep a FileSystemObject open across phases. Specifically, I
would like to open a text file during the Pre Source phase, write to that
file in the Row Transform phase, then close the file in the Post Source
phase. I thought I could keep the FileSystemObject in a Global Variable. I
have been unsuccessful in my attempts. Does anyone have an example of doing
something like this?

Thank you.

Gary



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: keep FileSystemObject across phases - 04-26-2005 , 11:36 AM






I haven't tried, but a guess would be set Execute on main thread in case the
task phase split accross threads. Right-click the task, Workflow Properties.

Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Gary" <GAry> wrote

Quote:
I would like to keep a FileSystemObject open across phases. Specifically,
I
would like to open a text file during the Pre Source phase, write to that
file in the Row Transform phase, then close the file in the Post Source
phase. I thought I could keep the FileSystemObject in a Global Variable. I
have been unsuccessful in my attempts. Does anyone have an example of
doing
something like this?

Thank you.

Gary





Reply With Quote
  #3  
Old   
Gary
 
Posts: n/a

Default Re: keep FileSystemObject across phases - 04-26-2005 , 11:47 AM



I can't get far enough for that to be a problem. I can't seem to store an
object in a Global Variable and retrieve it. Any examples? I could re-open
the file for append each time I get to the Row Transform phase, but that
seems like a lot of overhead.

Gary


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
I haven't tried, but a guess would be set Execute on main thread in case
the
task phase split accross threads. Right-click the task, Workflow
Properties.

Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Gary" <GAry> wrote in message
news:%23l%23bMqnSFHA.3236 (AT) tk2msftngp13 (DOT) phx.gbl...
I would like to keep a FileSystemObject open across phases.
Specifically,
I
would like to open a text file during the Pre Source phase, write to
that
file in the Row Transform phase, then close the file in the Post Source
phase. I thought I could keep the FileSystemObject in a Global Variable.
I
have been unsuccessful in my attempts. Does anyone have an example of
doing
something like this?

Thank you.

Gary



Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: keep FileSystemObject across phases - 04-26-2005 , 12:26 PM



I don't understand. Why can you not store and retrieve it? Errors?


Not an open file, but the idea is the same-

Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
...blah blah...

Set DTSGlobalVariables("FileObject").Value = oFSO

Dim oFSO2

Set oFSO2 = DTSGlobalVariables("FileObject").Value



Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Gary" <GAry> wrote

Quote:
I can't get far enough for that to be a problem. I can't seem to store an
object in a Global Variable and retrieve it. Any examples? I could re-open
the file for append each time I get to the Row Transform phase, but that
seems like a lot of overhead.

Gary


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:#Or5m5nSFHA.3088 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
I haven't tried, but a guess would be set Execute on main thread in case
the
task phase split accross threads. Right-click the task, Workflow
Properties.

Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Gary" <GAry> wrote in message
news:%23l%23bMqnSFHA.3236 (AT) tk2msftngp13 (DOT) phx.gbl...
I would like to keep a FileSystemObject open across phases.
Specifically,
I
would like to open a text file during the Pre Source phase, write to
that
file in the Row Transform phase, then close the file in the Post
Source
phase. I thought I could keep the FileSystemObject in a Global
Variable.
I
have been unsuccessful in my attempts. Does anyone have an example of
doing
something like this?

Thank you.

Gary





Reply With Quote
  #5  
Old   
Gary
 
Posts: n/a

Default Re: keep FileSystemObject across phases - 04-26-2005 , 02:23 PM



Yes, I'm getting errors. I'm reworking what I'm doing to see if I can
isolate where the problem is.

Gary


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
I don't understand. Why can you not store and retrieve it? Errors?


Not an open file, but the idea is the same-

Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
..blah blah...

Set DTSGlobalVariables("FileObject").Value = oFSO

Dim oFSO2

Set oFSO2 = DTSGlobalVariables("FileObject").Value



Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Gary" <GAry> wrote in message
news:e1avf%23nSFHA.164 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
I can't get far enough for that to be a problem. I can't seem to store
an
object in a Global Variable and retrieve it. Any examples? I could
re-open
the file for append each time I get to the Row Transform phase, but that
seems like a lot of overhead.

Gary


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:#Or5m5nSFHA.3088 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
I haven't tried, but a guess would be set Execute on main thread in
case
the
task phase split accross threads. Right-click the task, Workflow
Properties.

Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Gary" <GAry> wrote in message
news:%23l%23bMqnSFHA.3236 (AT) tk2msftngp13 (DOT) phx.gbl...
I would like to keep a FileSystemObject open across phases.
Specifically,
I
would like to open a text file during the Pre Source phase, write to
that
file in the Row Transform phase, then close the file in the Post
Source
phase. I thought I could keep the FileSystemObject in a Global
Variable.
I
have been unsuccessful in my attempts. Does anyone have an example
of
doing
something like this?

Thank you.

Gary







Reply With Quote
  #6  
Old   
Darren Green
 
Posts: n/a

Default Re: keep FileSystemObject across phases - 04-26-2005 , 05:20 PM



What is the full error message?


In message <erje0VpSFHA.3732 (AT) TK2MSFTNGP10 (DOT) phx.gbl>, Gary
<GAry@?.?.invalid> writes
Quote:
Yes, I'm getting errors. I'm reworking what I'm doing to see if I can
isolate where the problem is.

Gary


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message
news:uXEYqVoSFHA.1312 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
I don't understand. Why can you not store and retrieve it? Errors?


Not an open file, but the idea is the same-

Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
..blah blah...

Set DTSGlobalVariables("FileObject").Value = oFSO

Dim oFSO2

Set oFSO2 = DTSGlobalVariables("FileObject").Value



Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Gary" <GAry> wrote in message
news:e1avf%23nSFHA.164 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
I can't get far enough for that to be a problem. I can't seem to store
an
object in a Global Variable and retrieve it. Any examples? I could
re-open
the file for append each time I get to the Row Transform phase, but that
seems like a lot of overhead.

Gary


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:#Or5m5nSFHA.3088 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
I haven't tried, but a guess would be set Execute on main thread in
case
the
task phase split accross threads. Right-click the task, Workflow
Properties.

Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Gary" <GAry> wrote in message
news:%23l%23bMqnSFHA.3236 (AT) tk2msftngp13 (DOT) phx.gbl...
I would like to keep a FileSystemObject open across phases.
Specifically,
I
would like to open a text file during the Pre Source phase, write to
that
file in the Row Transform phase, then close the file in the Post
Source
phase. I thought I could keep the FileSystemObject in a Global
Variable.
I
have been unsuccessful in my attempts. Does anyone have an example
of
doing
something like this?

Thank you.

Gary






--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #7  
Old   
Gary
 
Posts: n/a

Default Re: keep FileSystemObject across phases - 04-27-2005 , 09:29 AM



Thanks for your help and example; that was what I needed. I resolved the
final problem. I had a typo that generated a misleading error message.

Gary


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
What is the full error message?


In message <erje0VpSFHA.3732 (AT) TK2MSFTNGP10 (DOT) phx.gbl>, Gary
GAry@?.?.invalid> writes
Yes, I'm getting errors. I'm reworking what I'm doing to see if I can
isolate where the problem is.

Gary


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:uXEYqVoSFHA.1312 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
I don't understand. Why can you not store and retrieve it? Errors?


Not an open file, but the idea is the same-

Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
..blah blah...

Set DTSGlobalVariables("FileObject").Value = oFSO

Dim oFSO2

Set oFSO2 = DTSGlobalVariables("FileObject").Value



Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Gary" <GAry> wrote in message
news:e1avf%23nSFHA.164 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
I can't get far enough for that to be a problem. I can't seem to
store
an
object in a Global Variable and retrieve it. Any examples? I could
re-open
the file for append each time I get to the Row Transform phase, but
that
seems like a lot of overhead.

Gary


"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:#Or5m5nSFHA.3088 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
I haven't tried, but a guess would be set Execute on main thread in
case
the
task phase split accross threads. Right-click the task, Workflow
Properties.

Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Gary" <GAry> wrote in message
news:%23l%23bMqnSFHA.3236 (AT) tk2msftngp13 (DOT) phx.gbl...
I would like to keep a FileSystemObject open across phases.
Specifically,
I
would like to open a text file during the Pre Source phase, write
to
that
file in the Row Transform phase, then close the file in the Post
Source
phase. I thought I could keep the FileSystemObject in a Global
Variable.
I
have been unsuccessful in my attempts. Does anyone have an
example
of
doing
something like this?

Thank you.

Gary







--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org




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.