web development India freelance website designer
There was a good tip for speeding up looping through a recordset in this tips section. (I have included it below for
reference) However, if you have the option, there is another way to perform an operation on every member of a recordset
that will execute much faster than any recordset operation, use a SQL UPDATE statement to modify the records. That
way, the modification executes on the database server, and gets whatever optimizations your database engine provides.
For example, to give all your longstanding customers a discount, you could use the following SQL statement in place of any
recordset:

UPDATE Customers SET Discount = 0.10 WHERE CustSince <= 1993
This could take the place of getting a recordset with the SQL:
SELECT Discount FROM Customers WHERE CustSince <= 1993
and then needing to navigate the whole recordset setting each Discount to 10%.
----------------------------------------------------------------------------
----------------------------------------------------------Accessing Databases

This tip is on accessing databases. For performing an operation in
every record of a Table or RecordSet (for example you could
want to update some fields, or retrieve some information), generally
this code is used.

Do
...
...
MyDynaset.MoveNext
Loop Until MyDynaset.EOF

Bat if you use this code

Dim k As Long, j As Long

MyDynaset.MoveLast
j = MyDynaset.RecordCount
MyDynaset.MoveFirst

For k = 1 to j
...
...
MyDynaset.MoveNext
Next

you should notice is 30% speed increase from the first code. I tried
this code with a MDB file with 17000 records, and with a MDB
file with 500 records. They both work well. The reason? Of course
because the second code does not check the EOF condition
every iteration (even if it must go to the last record and then to the
first record)! Maybe, if the recordset is small you may not notice
any improvement, but in this case, processing time is short anyway. I
found this code does not improve processing time in Delphi. I
think it's because Delphi EXE is compiled and not p-code.

Tip supplied by Castelli Stefano
Another way to speed up looping through a recordse

1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700

Freelance ASP PHP web development | Web developer India Web development India| Prayagasoft - web designer India, Ecommerce developer india, Ecommerce design