Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 989
RBA Avatar asked Oct 06 '11 14:10

RBA


People also ask

How do I find ODBC data source?

1. Click the Windows "Start" button and then click "Control Panel." Click "System and Security." Click "Administrative Tools" in the list of utilities. Double-click the icon labeled "Data Sources (ODBC)." A list of DSNs display.

How do I view ODBC files?

On the Start menu, click Control Panel. In Control Panel, click Administrative Tools. In Administrative Tools, click Data Sources (ODBC).

What is data source name in ODBC?

A data source name (DSN) is a data structure that contains the information about a specific database that an Open Database Connectivity ( ODBC ) driver needs in order to connect to it.


1 Answers

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

like image 64
da-soft Avatar answered Oct 05 '22 02:10

da-soft