We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.

Help! How to create a external sql connection? [Solved]

Anonymous
Not applicable
Hi all, im still new to ArchiCAD API so would like to ask for some help, a thank you in advance! Currently we trying to select data from our online MySQL server for our addon, was looking into odbc connection but sadly we can't find much information on how to create the connection to external sql server.
4 REPLIES 4
ReignBough
Enthusiast
I am currently using MySQL C++ Connector 1.1.3 to connect to external database.
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
Anonymous
Not applicable
Thanks for the reply ReignBough.

I have tried using MySQL C++ Connector 1.1.3 but without much success yet. I included all the MySQL header and .lib files in my Visual Studio project Src folder, as well as including the BOOST C++ library( required by the MySQL connector ). While it compiled perfectly, when I test it with the AddOnTool it just gives the error "Undefined Release". I think it may have to do with the MySQL .lib or BOOST files not being included into ArchiCAD correctly?
ReignBough
Enthusiast
Here's what I did:
  • Open project property.
  • Add include directory of MySQL Connector to Configuration Properties > C/C++ > General > Additional Include Directories.
  • Add lib/opt directory of MySQL Connector to Configuration Properties > Linker > General > Additional Library Directories for release mode.
  • Add mysqlcppconn.lib to Configuration Properties > Linker > Input > Additional Dependencies for release mode. NOTE: Their documentation says that you should also include libmysql.lib but it is not found on the said directory.
  • Also, you need to install BOOST and add its main folder to Additional Include Directories.
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
Anonymous
Not applicable
Thanks ReignBough we've got it working.