C-API and mysql connection

Kristoffel De Geest kdg1955 at gmail.com
Tue Jun 17 09:44:18 EDT 2014


As an experienced C programmer, I tried to delve into the C-API of GnuCash.
Everything seems very straightforward. But I sucker on one important point:
how do I link the mysql data to the QofBook structure.
Presumably "gnc_sql_init" and "gnc_sql_load" are the appropriate functions.
But here I can not find any parameter for the connection string (eg
mysql://myName@myhost/myDB). Or I find nowhere a function that initializes
all this via configuration files.
Is there a template available that can solve my problem or is there a
sample source file? The sample programs found at "
http://wiki.gnucash.org/wiki/C_API" give no clarity. Even Google could not
help me.

BTW: the purpose of the C-API application is to import several hundred
commodities (one shot) and the latest prices (daily run).
Maybe the import of the prices can be done inside GnuCash via the import of
a QIF file (not yet tried) but I prefer to automate this. However the
import of new commodities failed with a QIF file because GnuCash try to
create directly the accounts, and propose me to enter the missing
commodities one by one. Version of GnuCash: 2.4.15 (Fedora package)

It is not clear to me whether this is the right mailing list for my C-API
problem. If "gnucash-devel" is more appropriate, I will also ask my
question there.


Thanks in advance for your help.

--
 kdg1955


More information about the gnucash-user mailing list