Re: Populate dataset with text file
- From: "Dan Rock" <danno492_NOSPAM@xxxxxxxxxxx>
- Date: Tue, 23 Aug 2005 07:18:01 -0400
Commenting out the inserts, It takes about 45 seconds to populate a text box
one row at a time.
If I use Memo1.Lines.LoadFromFile I can populate a memo control in less than
a second.
strPath := 'C:\Program
Files\Borland\Delphi7\Projects\PPM\832\00000001.832';
Memo1.Lines.LoadFromFile(strPath);
Below is a sample of the actual file after being read into the memo control:
ISA*00* *00* *01*045840055 *ZZ*POTOMFC
*050524*1230*U*00400*000000001*0*P*>
GS*SC*045840055*POTOMFC*20050524*1230*1*X*004010
ST*832*0001
BCT*PS
CUR*SE*USD
REF*11*0022096
LIN**GS*AL021*MF*SHAW IND*ST*AL021*****MS*AL021*MN*MADISON II
DTM*007*20040507
REF*GP*ABBEY
REF*19**60 HARD SURFACES WHOLES
REF*GG*CUT PILE
PID*F*TRN***MADISON II
PID*F*MAC***LAMFLO
PID*F*CO***ABBEY LAMINATE
PID*F*12***WOOD LAMINATE FLOORS
MEA**LN*047.00
MEA**WD*011.00
CTP**LPR*2.72*0*SF****ST
CTP**LPR*0*1*SF****CT
G43*003**ZONE2
SLN*00001**O******SK*AL02100170*****ST*AL021*****MS*AL021*MN*MADISON II
PID*F*73***SANIBEL
If I can find a way to simple either make a temp table or populate an
existing table using the asterisk as a field delimiter, I am thinking it
should take considerably less time than populating a dataset one record at a
time.
By the way, Bill, thanks for hanging in there with me on this.
"Bill Todd" <no@xxxxxx> wrote in message
news:430a7cff$1@xxxxxxxxxxxxxxxxxxxxxxxxx
>I would be very interested to know the time it takes for the 147,000
> records if you comment out the code that actually inserts the row into
> the database table. There are other ways to do the import that might be
> faster.
>
> Also, how are you adding the records to the table. ADO will be much
> slower than the Advantage TDataSet components. The two possibilities
> are a TAdsTable or a TAdsQuery using a parameterized insert statement.
> I would expect the TAdsTable to be faster but I have not tested this.
>
> --
> Bill Todd (TeamB)
.
- Follow-Ups:
- Re: Populate dataset with text file
- From: Bill Todd
- Re: Populate dataset with text file
- References:
- Populate dataset with text file
- From: Dan Rock
- Re: Populate dataset with text file
- From: Bill Todd
- Re: Populate dataset with text file
- From: Dan Rock
- Re: Populate dataset with text file
- From: Bill Todd
- Re: Populate dataset with text file
- From: Dan Rock
- Re: Populate dataset with text file
- From: Bill Todd
- Re: Populate dataset with text file
- From: Dan Rock
- Re: Populate dataset with text file
- From: Bill Todd
- Populate dataset with text file
- Prev by Date: Re: Not in edit mode?
- Next by Date: Re: Populate dataset with text file
- Previous by thread: Re: Populate dataset with text file
- Next by thread: Re: Populate dataset with text file
- Index(es):
Relevant Pages
|