Code for MySQL wanted lazarus / 16-Databases ---------------------------------------------------------------------- thorsten · 2012-02-27 07:04 Dear all, first of all: my Pascal knowledge is 20 years old and I do not have any knowledge on programming. However for a current problem I need to prepare a dll in Delphi / Pascal with a simple procedure. For this problem I installed Free Pascal / Lazarus. And I made it already running. The Problem: The input (just two or three values, the read out from weather sensons  + current date) to my dll shall be be written to a known MySQL Table in a known MySQL Database of a known server (I created / uinstalled it). I already managed to get the dll running as I simply linked examples snippets to a working code  - it does convert my input variable to an output - just the square root of the input. it works as requested. Now I need to progress further - The calculated result shall be written to MySQL. Can someone provide just a tiny little code which does connect and write my varibales to mysql. It should be easy for me to identfiy the required handles - host, database, password, user, port etc. All infos are available. However the examples on the wiki are just dealing with MySQL queries and the connection to an unknown database via a form sheet - which I must not use within my DLL. Thank you for any help, best regards Thorsten ---------------------------------------------------------------------- Arbee · 2012-02-27 08:31 This link did not help? http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial#Lazarus_a nd_MySQL ---------------------------------------------------------------------- joseme · 2012-02-27 14:35 The simplest way may be using Zeos components, you can find an use example here: http://www.todoexpertos.com/categorias/tecnologia-e- internet/programacion/delphi/respuestas/331673/uso-de-los-componentes- zeos and here: http://lazaruszeos.blogspot.com/ ---------------------------------------------------------------------- BigChimp · 2012-02-28 11:08 I'd look at Arbee's link as well. Can't remember but Zeos might only have graphical components; in any case, it's another component that you'd need to manage on top of FPC. SQLDB (the FPC database layer) comes built with the product... Using that, you can, just like with Zeos, fairly easily swap out one database for another. Note: for a new database project I would not use MySQL but Firebird (or PostgreSQL) as apparently the various client versions break compatibility, which needs effort by driver maintainers to update their code (see other posts in the forum). However, if you're committed to MySQL, I suppose you may live with that (I'm not in that situation and don't really know)