Home All Groups Group Topic Archive Search About
Author
5 Jul 2005 7:49 PM
M> <M
Hello,

I'm attempting to develop a class that processes a flat file but i'm a
little uncertain on the best approach. Here's what I have already in case you
are able to provide any coments...

A flat file is recieved that consists of an unknown number of repeated
sections. The intention is to read each section in turn and then to import
that sections data into a relational database (SQL Server) before moving onto
the next section. I'm currently intending to call a class to test the file
exists, to test the file contains data, to test the file contains valid data,
to read the first section and return the data to the main app for inclusion
into the database, to read the next section and return the data to the main
app for inclusion into the database, ...

Am I going to cause excesive load on the server by continually accessing the
flat file using a FSO call? Woulkd it be better to read the entire file and
save it into an array/recordset(?) and then import the data from that source?

I'm a little limited in development style as I am restricted to VB6 and no
XML.

Any advice would be appreciated.

<M>

Author
5 Jul 2005 8:37 PM
Tim Baur
=?Utf-8?B?PE0+?= <M@discussions.microsoft.com> wrote in
news:265F0FD8-A032-46BC-B779-74D36C6DD9BB@microsoft.com:


> Any advice would be appreciated.
>
> <M>
>

Look into Data Transformation Services.  The objects can be referenced from
VB and distributed as a stand-alone.
Author
5 Jul 2005 9:19 PM
M> <M
Thanks for the tip Tim, but unfortunately all the validation routines for the
data have already been written by the receiving softwares manufactures and
require that the data be passed to it through COM objects. As far as I
understand, DTS won't pass the data back to a COM object as it'll only import
(or transfer) the data to SQL Server or other data repositories.

Any tips on the 'best approach' to dealing with these files?

<M>

Show quoteHide quote
"Tim Baur" wrote:

>
> Look into Data Transformation Services.  The objects can be referenced from
> VB and distributed as a stand-alone.
>
Author
6 Jul 2005 2:13 PM
Tim Baur
=?Utf-8?B?PE0+?= <M@discussions.microsoft.com> wrote in
Show quoteHide quote
news:824F3E9E-3DB3-4370-92B1-D699E7DC2A27@microsoft.com:

> Thanks for the tip Tim, but unfortunately all the validation routines
> for the data have already been written by the receiving softwares
> manufactures and require that the data be passed to it through COM
> objects. As far as I understand, DTS won't pass the data back to a COM
> object as it'll only import (or transfer) the data to SQL Server or
> other data repositories.
>
> Any tips on the 'best approach' to dealing with these files?
>
> <M>
>
> "Tim Baur" wrote:
>
>>
>> Look into Data Transformation Services.  The objects can be
>> referenced from VB and distributed as a stand-alone.
>>
>

Instead of a proactive approach, try a reactive one.  Use DTS to plug
the file into a temp table, query the data back into your object as a
recordset, and use your validation routines to weed the bad ones.

I don't think anything will be faster or easier than DTS for putting a
file into SQL Server.
Author
6 Jul 2005 3:59 PM
M> <M
Ok,

I'll give it a go as it certainly seems a better idea than opening and
closing the file all the time.

Thanks,

<M>

Show quoteHide quote
>
> Instead of a proactive approach, try a reactive one.  Use DTS to plug
> the file into a temp table, query the data back into your object as a
> recordset, and use your validation routines to weed the bad ones.
>
> I don't think anything will be faster or easier than DTS for putting a
> file into SQL Server.
>