delphiodbcadodelphi-2006

Get the list of ODBC data source names programmatically using Delphi


I saw several examples where the list of the source names were took from registry (HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\ODBC Data Sources). Is there any other way to get the list of ODBC data sources names?

I need to work only with Delphi standard components, so I can not use 3d party solutions.


Solution

  • You have to use SQLDataSources function from ODBC32.DLL. For example.