Take the 2-minute tour ×  I am working on completely redeveloped
website and sales system and have come up against this
Max_connections issue surprisingly quickly.  I posted this
question: Closing/Pooling MySQL ODBC connections Recently, but
have since tried a few other things, still drawing a blank, but
have more detail to offer...  I have a built a pretty complex
sales process, and in creating an invoice I seem to be leaving 7
"processes" running each time. I have counted the number of
times the data connection is used during the process of creating
an invoice, and it is 7-9 depending on a few conditional values,
so effectively the data connections are not closing at all.  To
try to speed up coding, I have made a couple of functions which
handle my database connectivity, so I will post these below.
Firstly, my connection string is:  "DRIVER={MySQL ODBC 3.51
Driver}; SERVER=mysql.dc-servers.com; DATABASE=jamieha_admin;
UID=USERID; PASSWORD=pWD; OPTION=3;pooled=true;Max Pool
Size=100"   The functions which I