Home | Sign in | English EN
  • Overview
  • Setup
  • Configuration
  • Use
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
ODBC on HFSQL via Visual .NET (in C#)
HFSQLAvailable only with this kind of connection
The ODBC driver on HFSQL Classic (single-user and multi-user) is used to access a HFSQL Classic database from an external database software that supports ODBC accesses. This gives you the ability to use the ODBC driver on HFSQL Classic via Visual.NET (in C#).
Remark: From version 19, HFSQL is the new name of HyperFileSQL.


When installing WINDEV or WEBDEV on the development computer, the ODBC driver can be installed on HFSQL Classic.
Furthermore, when configuring the setup program of your WINDEV applications, you have the ability to include the setup of the ODBC driver on HFSQL.
To use the ODBC driver on HFSQL, you must configure the ODBC driver:
  1. Start the administrator of ODBC data (ODBCAD32.EXE) on your computer. To do so, select "Start .. Run" from Windows and type "ODBCAD32.EXE".
  2. Select the "User database" tab.
  3. Click the "Add" button.
  4. Select the "HyperFileSQL Classic" driver.
  5. Click "Done".
  6. Enter the name of the HFSQL data source. This name will be used to identify the HFSQL database in the external programs.
  7. Click the "Details" button.
  8. Click "Browse" to select the WDD file corresponding to the analysis.
  9. In the list of analyses, select the requested analysis and the directory of the data files ("Browse" button). All the HFSQL data files corresponding to the selected analysis are grouped in this directory.
    Caution: a file directory must be selected for each analysis.
  10. Validate ("OK" button).
The database can be used in read/write from the external programs via the ODBC driver on HFSQL Classic.
Example of code used to handle the ODBC driver on HFSQL from your Visual .NET program:
// Sample code for using a HFSQL database by ODBC
namespace ConsoleApplicationTestODBC
class Sample
public static void Main()
// Connection by using a DSN
// MyODBCDatabase is an ODBC data source defined with odbcad32
// OdbcConnection nwindConn = new OdbcConnection("DSN=MyODBCDatabase");
// Connection by passing the connections parameters directly
// ANA=<Full path of the analysis>
// DIR=<Directory of the files>
OdbcConnection MyConnection =
new OdbcConnection("Driver={HyperFileSQL};ANA=c:\test\\MyAnalysis.wdd;DIR=c:\test\\;");
// Open the connection
// Query that must be run on the database
OdbcCommand MyQuery = new OdbcCommand("SELECT * FROM MyFile", MyConnection);

// Run the query
OdbcDataReader MyData = MyQuery.ExecuteReader();
// Browse the result of the query
while (MyData.Read())
Console.WriteLine("\t{0}\t{1}", MyData.GetInt32(0), MyDatas.GetString(1));
catch(OdbcException eExcpt)
// Display the errors
Console.WriteLine("Source = " + eExcpt.Source);
Console.WriteLine("Message = " + eExcpt.Message);
// pause before exiting

Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment