ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Example 1: Performing multiple directory substitutions (HFSQL data files)
  • Example 2: Changing the database name (OLE DB)
HSubstDir (Example)
Example 1: Performing multiple directory substitutions (HFSQL data files)
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)AjaxHyper File 5.5 The following example is used to perform some directory substitutions:
  • for data files described in the "Current directory"
  • for data files described in a specific directory (C:\File).
// Close all data files before changing directory
HClose("*")

// Change directory for data files defined in
// the "current directory" in the analysis
HSubstDir(".", "d:\file")

// Change directory for data files defined in
// a specific directory in the analysis
HSubstDir("c:\file", "d:\file")

// Open/create data files in the new directory
HCreationIfNotFound("*")
Example 2: Changing the database name (OLE DB)
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)AjaxOLE DB This example is used to change the name of the database. The name of the database specified in the analysis is "c:\Access\MaDatabase.mdb." However, on the client's workstation, the name of the database is not necessarily identical (e.g., "d:\My Documents\DataBaseClient.mdb").
HSubstDir enables you to change the name of the database that will be used by all the OLEDB tables associated with a connection on the "c:\Access\MyDatabase.mdb" database.
// Fermeture de tous les fichiers de données avant le changement de répertoire
HClose("*")

// Changement du nom de la base de données
// ici une base Access : MaDataBase.mdb
HSubstDir("c:\Access\MaDatabase.mdb", "d:\Mes Documents\DataBaseClient.mdb")

// Ouverture/création des fichiers de données dans la nouvelle base de données
HCreationIfNotFound("*")
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help