Hello,
I'm using ADO and at the begin op my program I open a connection to the SQL-server.
This program is running for a long time, and sometimes I get a ''MySQL server has gone away'-error.
This is always when executing a command like 'INSERT INTO', not with recordsets. With recordsets, I allways create a new recordset when reading data.
That was the same problem that I had after resuming al laptop.
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=28763&p=161537&hilit=connection+laptop#p161537
Now I was wondering if it would be beter to not open a connection at the beginning of the program and close in at the end,
but open a connecion only if i want to execute a SQL-command, like 'INSERT INTO',.. and than close it again.
For reading data I allways use a recordset, and than I also open it before reading.
Will the program become slower by allways opening and closing a connection? Are there other disadvantages doing this?
Are there other people do this also?
I'm using ADO and at the begin op my program I open a connection to the SQL-server.
This program is running for a long time, and sometimes I get a ''MySQL server has gone away'-error.
This is always when executing a command like 'INSERT INTO', not with recordsets. With recordsets, I allways create a new recordset when reading data.
That was the same problem that I had after resuming al laptop.
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=28763&p=161537&hilit=connection+laptop#p161537
Now I was wondering if it would be beter to not open a connection at the beginning of the program and close in at the end,
but open a connecion only if i want to execute a SQL-command, like 'INSERT INTO',.. and than close it again.
For reading data I allways use a recordset, and than I also open it before reading.
Will the program become slower by allways opening and closing a connection? Are there other disadvantages doing this?
Are there other people do this also?
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite