FAQ #19548, published on 2015-12-16, updated on 2019-12-16
How to prevent a MySQL error after repetitive accesses ?

It has been experienced that the MySQL Client layer (libmysql.dll 5.x or 6.x) may cause an error when used repetitively (such as 1.000 times) by the same process. A simple workaround to avoid such an error is to allocate the LIBMYSQL dll once in the project initialization code, before accessing the database.


sDllMySQL is string = "LibMySQL.DLL"
nInstanceMySQL is int = LoadDLL(sDllMySQL)

IF nInstanceMySQL=0 THEN
EndProgram("Error loading LIBMYSQL", ErrorInfo())
END

See also : libmysql