Re: keep FileSystemObject across phases

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



What is the full error message?


In message <erje0VpSFHA.3732@xxxxxxxxxxxxxxxxxxxx>, 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@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:uXEYqVoSFHA.1312@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
> news:#Or5m5nSFHA.3088@xxxxxxxxxxxxxxxxxxxxxxx
> > 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@xxxxxxxxxxxxxxxxxxxxxxx
> > > 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

.



Relevant Pages

  • Re: Copy array dump onto text file
    ... Dim oFSO, oFile ... Set oFSO = ... Set oFile = oFSO.CreateTextFile ... > For Each User In Container ...
    (microsoft.public.scripting.vbscript)
  • Re: VBA Code return value in Excel
    ... Sub SerialNumber() ... Dim oFSO As Object ... Set oFSO = CreateObject ...
    (microsoft.public.excel.programming)
  • Re: VBA Code return value in Excel
    ... Sub SerialNumber() ... Dim oFSO As Object ... Set oFSO = CreateObject ...
    (microsoft.public.excel.programming)
  • Re: How to get the file created date in VBA?
    ... Dim oFSO As Object ... Set oFSO = CreateObject ... >I've tried using FileDateTime function, but it returns the modified date. ... John Nurick [Microsoft Access MVP] ...
    (microsoft.public.access.formscoding)