AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Multiple changes of directory
  • Changing the name of data file
  • Substituting directories
  • Miscellaneous
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
  • Changes the access path to a data file (i.e. the directory in which the data file will be manipulated). If the data file is opened when using HChangeDir, the data file is automatically closed.
    Reminder: By default, the physical file corresponding to the data file described in the analysis is handled in the directory specified in the analysis.
  • Changes the name of database associated with a table. In this case, the database name specified in the connection properties of table (in the data model editor) is ignored.
    To modify the connection parameters of a data file not in HFSQL format, we recommend that you use HDescribeConnection and HChangeConnection.
Java This function only works for connections to an HFSQL database.
Ejemplo
WINDEVWEBDEV - Código ServidorReportes y ConsultasJavaCódigo de Usuario (UMC)AjaxHFSQL ClassicHyper File 5.5
// Create the HFSQL Classic Stat data file in
// "C:\Statistics\January"
HChangeDir(Stat, "C:\Statistics\January")
HCreation(Stat)
WINDEVWEBDEV - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)AjaxHFSQL Client/Server
// Create the HFSQL Client/Server Stat data file in "\January\"
// This directory is at the root
// of database folder (HFSQL Client/Server connection)
HChangeDir(Stat, ".\January\")
WINDEVWEBDEV - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)AjaxOLE DBConectores Nativos
// Data file associated with a connection by OLE DB.
// Replace the database that will be used for the "Customers" table
HChangeDir(Customers, "C:\Temp\MyTestDB.mdb")
HCreation(Customers)
// The "Customers" table was created in the "c:\temp\mytestdb.mdb" database
// The "Customers" table of database ("c:\temp\myinitialdb.mdb") was not modified
Sintaxis

Use with HFSQL data files Ocultar los detalles

<Result> = HChangeDir(<Data file> , <New data file path>)
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HError is used to identify the error.
<Data file>: Character string
Logical name of the HFSQL data file defined in the analysis.
If this parameter is set to "*", the directory will change for all data files:
  • defined in the current analysis,
  • defined in the application's main analysis (for projects with multiple analyses).
This parameter can also correspond to the name of a group of files (or custom-folder) defined in the analysis (not available in Android and Android widget).
<New data file path>: Character string
New access path to the data file (up to 260 characters). This path can contain the name of drive and directories, or it can be a relative path.
If the path is a relative path, the "." (or "?") character is used to specify the current directory and the ".." character is used to specify the parent directory.
If this parameter corresponds to an empty string (""), the data file will be handled in the directory specified in the analysis.
HFSQL Client/Server The access path to the data file must be relative to the database found on the server. You cannot specify a path outside the database. A WLanguage error occurs when attempting to access data files outside the database. For example:
Valid path:
HChangeDir(FileName, "SUBDIR")
OR 
HChangeDir(FileName, ".\SUBDIR")

Invalid path:
HChangeDir(FileName, "C:\DB\SUBDIR")

The new path will be automatically created if it is valid and if it does not exist.
iPhone/iPad This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: On iPhone or iPad, an application has the rights to write to its installation directory or one of its subdirectories
WINDEVWEBDEV - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)AjaxOLE DBConectores Nativos

Use with an OLE DB access or a Native Connector Ocultar los detalles

<Result> = HChangeDir(<Data file> , <New database>)
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HError is used to identify the error.
<Data file>: Character string
Logical name of table (defined in the analysis).
If this parameter is equal to "*", HChangeDir is ignored.
Warning If this parameter is equal to "*" and if one of the analysis data files has been associated with a connection (function HChangeConnection) before using the function HChangeDirfunction, the directory modification will be taken into account for this data file only when the connection is closed.
<New database>: Character string
Access path to database to use (up to 260 characters). In this case, the database name specified in the connection properties of table in the analysis is ignored.
This path can contain the name of drive and directories, or it can be a relative path.
If the path is a relative path, the "." (or "?") character is used to specify the current directory and the ".." character is used to specify the parent directory.
Observaciones

Multiple changes of directory

HChangeDir can be called several times with different parameters. When the path is redefined several times for the same data file, the last specified path replaces all the other ones.

Changing the name of data file

HChangeDir can only be used to change the access path to the physical data file. To change the physical name of the data file, use HChangeName.

Substituting directories

HChangeDir is used to associate a directory with a data file. To replace a directory with another one, use HSubstDir.
Caution: Directory substitution by HSubstDir applies to the directory defined by HChangeDir. For example:
HSubstDir("C:\Statistics\January", "C:\New\JanStats")
HChangeDir(Stat, "C:\Statistics\January")
HCreation(Stat) // Data file created in C:\New\JanStats

Miscellaneous

  • If the ".REP" file is used (HSetREP), the new path is saved to the ".REP" file (see management of .REP files).
  • Closing the data file stores the new path but does not store a possible password specified when opening the data file.
  • HChangeDir is equivalent to HAssign, available in earlier versions.
  • This function can be used when establishing a connection with an HFSQL server.  Caution: The order of use of functions for connecting to an HFSQL Client/Server database is important.. For more details, see Optimizing the connection times to the HFSQL Client/Server databases.
  • Conectores Nativos HChangeDir can be used with the Native XML Connector.
Componente: wd300hf.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 06/12/2024

Señalar un error o enviar una sugerencia | Ayuda local