To use a Sybase database with Native Connector, the structure of Sybase tables must be imported into the WINDEV or WEBDEV analysis.

Differences compared to SQL programming: The queries are not required to handle the Sybase data. Indeed, the HFSQL functions can be directly used to read data, perform searches, implement filters, ... However, the structure of Sybase files must be imported into the WINDEV or WEBDEV analysis.

In the data model editor, select "Structures of files .. Import the descriptions of files/tables".On the "Analysis" pane, in the "Creation" group, expand "Import" and select "Import the descriptions of files/tables".

The wizard starts. A connection to the Sybase database is automatically established and it is associated with the files imported into the analysis. This connection will be used to handle the Sybase data file by programming.

In the different wizard screens, choose the following options:

Data source: External database

The data in current format will be used by the application

Select the "Native Sybase Access" type, the data source, the user name and the password. The "Properties" button is used to access the system properties.

When the connection is established, all you have to do is select the tables that will be imported into the WINDEV analysis. These tables can be handled by programming with the HyperFileSQL functions of WINDEV or WEBDEV. These tables will be displayed in blue in the data model editor.

In the different wizard screens, choose the following options:

Database Type: Sybase.

Characteristics of the connection: Data server, User and password, database.

The application will access the data in the current format.

When the connection is established, all you have to do is select the tables that will be imported into the WINDEV or WEBDEV analysis. These tables can be handled by programming with the HFSQL functions of WLanguage. These tables will be displayed in blue in the data model editor.

Taking into account the evolutions of the Sybase database

To take into account the evolutions of tables imported into the data model editor, select "Structure of files .. Synchronize the analysis with the external databases".To take into account the evolutions of the tables imported into the data model editor, on the "Analysis" pane, in the "Analysis" group, expand "Synchronization" and select "Update the analysis from the external databases".

A wizard starts, allowing you to:

analyze the differences for the imported tables.

analyze the differences for all the Sybase tables.

Programming

1. Establishing the connection

To establish the connection to the Sybase database, use HOpenConnection and specify the name of the connection to open. The connection name was defined when importing the structure of files into the analysis.

To modify some parameters of this connection (user name or password for example), call HConnect.

Note: If you try to read the file directly (HReadFirst, ...), the connection associated with the file description in the analysis will be automatically opened.