It depends...
Microsoft's ActiveX Data Objects give you a high level interface that add abilities that you may or may not need and involve ActiveX, OLE and ODBC.
The DB2 libraries will give you direct data access and low overheads.
If you know ADO and slower speed and greater size do not matter or you want flexability - use it.
If you want speed and as small a footprint as is possible then use the DB2 libraries. The interface should be a basic set of open/connect, close, read, write, create and modify functions and possibly SQL and other high level functions.
Here's an example of a direct interface in Perl from an article I wrote:
http://www-128.ibm.com/developerworks/edu/l-dw-linuxperl-i.html'
Read up at:
http://msdn.microsoft.com/library/de..._oledb-db2.asp