DbConnect
ODBC function.
The DbConnect function makes a connection to an ODBC database. Not available in WinTask Lite.
Syntax
DbConnect("DSN=<database_ODBC>")
or
ret=DbConnect("DSN=<database_ODBC>")Parameter
<database_ODBC> : exact name of the ODBC database as declared in the ODBC icon from Contro Panel
(double check the configuration of this) . The keyword DSN is mandatory as only ODBC databases can be accessed using WinTask. The database name can be followed by other parameters required to open it, such as userid and password.
Return value
Ret, numeric return code. If the specified database has been opened successfully, the function returns 0, otherwise use this return code for error management.
Examples
DbConnect("DSN=gpao;PWD=SILOG") ' connection to an ODBC database called gpao
DbConnect("DSN=SQLTEST ;UID=MICHEL ;PWD=ABC") ' connection to an ODBC database called SQLTEST for the user Michel using the password ABC.