PaidtheUmpire
Programmer
I have a Delphi program which inserts records from text files into an Access database. The system has become very slow as of late and i am wondering if there is a simple way to speed it all up again.
The program currently does the following:
[ol]
[li]Setup Variables[/li]
[li]Collects new record details[/li]
[li]Finds out which type of record it is[/li]
[li]Does appropriate procedure[/li]
[li]Inserts into database[/li]
[li]Updates program screen[/li]
[li]Goes on to next file (ie goto 2.)[/li]
[/ol]
Since the database has got more than 50,000 records in the system the insertion of records has slowed up dramatically. I have a couple of ideas but I have have no idea if they'll work or how to actually do them.
Idea 1. Insert all the new records into the dummy database and after all records are inserted into the dummy the program will transfer all the new records to the real database.
Idea 2. Insert all the new records into a textfile and then insert the completed textfile into the database.
Idea 3. Redo the insertion of records part of the program to speed it up.
Anyways here is the way i insert the records into the database (one at a time):
There is a large amount of code for the whole program and i can't really put it up here. Any other ideas or ways of how to do my ideas would be great.
Delphi I can't get enough of you.
The program currently does the following:
[ol]
[li]Setup Variables[/li]
[li]Collects new record details[/li]
[li]Finds out which type of record it is[/li]
[li]Does appropriate procedure[/li]
[li]Inserts into database[/li]
[li]Updates program screen[/li]
[li]Goes on to next file (ie goto 2.)[/li]
[/ol]
Since the database has got more than 50,000 records in the system the insertion of records has slowed up dramatically. I have a couple of ideas but I have have no idea if they'll work or how to actually do them.
Idea 1. Insert all the new records into the dummy database and after all records are inserted into the dummy the program will transfer all the new records to the real database.
Idea 2. Insert all the new records into a textfile and then insert the completed textfile into the database.
Idea 3. Redo the insertion of records part of the program to speed it up.
Anyways here is the way i insert the records into the database (one at a time):
Code:
SystemData.Tbl_SBD_Rec.Insert;
SystemData.Tbl_SBD_Rec.Edit;
SystemData.Tbl_SBD_Rec.FieldByName('Client_Reference_Number').AsString:= CRN;
SystemData.Tbl_SBD_Rec.FieldByName('IMEI_Number').AsString:= IMEI;
SystemData.Tbl_SBD_Rec.FieldByName('MSISDN_Number').AsString:= MSISDN;
SystemData.Tbl_SBD_Rec.FieldByName('Start_Date_And_Time').AsString:= FullTime;
SystemData.Tbl_SBD_Rec.FieldByName('Number_Of_Bytes_Sent').AsString:= NoBytes;
SystemData.Tbl_SBD_Rec.FieldByName('Cost_To_Fastwave').AsString:= CostD + '.' + CostC;
SystemData.Tbl_SBD_Rec.FieldByName('Cost_To_Client').AsCurrency:= CostClient;
SystemData.Tbl_SBD_Rec.FieldByName('Number_Called').AsString:= PhoneNo;
SystemData.Tbl_SBD_Rec.FieldByName('CTC_Currency').AsString:= CTC;
SystemData.Tbl_SBD_Rec.FieldByName('InvoiceType').AsString := InvoiceWords;
SystemData.Tbl_SBD_Rec.FieldByName('FileName').AsString := Part2;
SystemData.Tbl_SBD_Rec.FieldByName('LineNo').AsString := IntToStr(LineNo);
SystemData.Tbl_SBD_Rec.Post;
There is a large amount of code for the whole program and i can't really put it up here. Any other ideas or ways of how to do my ideas would be great.
Delphi I can't get enough of you.