Gentee Programming Language > Documentation > Libraries Download documentation

odbc.connect

You can connect to a database using a string connection or a DSN name.

The method is called in order to connect to the database with the help of the string connection. Use The ODBC connection string for this purpose, that contains a driver type, a database name and some additional parameters. The example below shows a type of the string connected to the SQL server: "Driver={SQL Server};Server=MSQLSERVER;Database=mydatabase;Trusted_Connection=yes;"
 
uint odbc.connect(
      str   connectstr
)

Parameters

connectstrConnection string.

Return value

Returns 1 if the connection is successful; otherwise, returns 0.


This method is used to connect to the database through the previously defined connection (the DSN name).
 
uint odbc.connect(
      str   dsn,
      str   user,
      str   psw
)

Parameters

dsnName of a previously defined connection - DSN.
userUser name.
pswUser password.

Return value

Returns 1 if the connection is successful; otherwise, returns 0.

See also

    Data Access Using ODBC


 Copyright © 2004-2006 Gentee Inc. All rights reserved.