| GNOME Data Access 4.0 manual |
|---|
The Configuration section details how to manage data sources definitions. To define a data source, one needs to create and fill a GdaDataSourceInfo structure, and use the gda_config_define_dsn() function.
For example the following code defines a data source:
GError *error = NULL;
GdaDataSourceInfo dsn_info = {
"My DSN",
"MySQL",
"Sample MySQL data source",
"HOST=myserver;DB_NAME=testdb"
NULL,
FALSE
};
if (!gda_config_define_dsn (&dsn_info, &error)) {
/* an error occurred, the details are in error */
g_error_free (error);
}