File: SAMPLES\SOLUTION\WINAPI\REGODBC.SCX
This example shows how to access the Windows Registry using the native Visual FoxPro DECLARE-DLL command. The Windows API provides a number of functions you can use to access, read and write to the registry. The REGISTRY.PRG class library in \SAMPLES\CLASSES contains a class definition that exposes these functions as methods that you can call in your applications.
The Registry contains a listing of all installed ODBC drivers and data sources. If your application relies on using ODBC, then you might want to perform a Registry check to see if a particular driver or data source is installed. This example shows how to query for ODBC information.
LOCAL oReg,regfile,nErrNum,lDrivers
PUBLIC aODBCData
regfile = HOME()+"samples\classes\registry.prg"
SET PROCEDURE TO (m.regfile) ADDITIVE
oReg = CreateObject("ODBCReg")
DIMENSION aODBCData[1]
m.nErrNum = oReg.GetODBCDrvrs(@aODBCData)