Oh yeah, a couple of more things. We had a LOT of code using the BDE. I
created our own set of DB objects derived from the ADO objects but that
provided properties and methods that were compatible with the BDE. This was
not a small project but we avoided changing the bulk of our code.
Also, use parameterized SQL statements. This is in general and not ADO
specific. Any real DB engine (Oracle, SQL Server, DB2) will cache SQL
statements after parsing and execution. The execution plan is also saved.
Therefore, if you execute a statement like (below) multiple times,
SELECT * FROM Atable WHERE Foo = :foo and Bar = :bar
The DB server will use the cached statement. Whereas, executing:
SELECT * FROM Atable WHERE Foo = 2 and Bar = 5
SELECT * FROM Atable WHERE Foo = 15 and Bar = 55
will be seen as two distinct statements. The second execution will be
In addition, using parameters for date and string means you don't have to
worry about date formats and dequoting strings.