I have an application which is using the ODBC driver. It is more or less build by following this small tutorial http://edn.embarcadero.com/article/25639.
My question is: let's say that I'm asking from database to bring in application almost 100k records through a query. But, before I got the results the application will be closed (software design which is not made by me). What's happening with the ODBC driver? It will freeze? Memory used by the driver will increase? How should I manage this 'potential' problem, if exists?
I don't understand if the problem you are asking about is one you've experienced (freezing, memory increase) or just one you are asking and in any case the answer probably depends on the ODBC driver and database. If you are half way through retrieving a large result-set and simply call SQLFreeStmt(SQL_CLOSE) what happens next will depend on the ODBC driver and database. Some ODBC drivers talk to the database using a protocol which is synchronous and it may not be possible for the ODBC driver to inform the database it no longer needs any more rows - they just get sent and as the ODBC driver does not know what you are going to do next, it will have to read all that data but throw it away (which may be seen as a pause especially when the result-set is large). Some may be able to send some sort of signal to the database saying stop sending rows.
Either way, at the end as the application is closed memory use is neither here or there. It is good practise to try and tidy up when your app is closed but it shouldn't really matter unless the driver creates some system resources which are not cleared up properly.