I have a couple of applications that I have designed in VB6 with MySql Backend, that I am currently working on converting to php. But Before I can fully convert I have to make sure that the vb apps keep running correctly. I have three apps that use a database(dbname=msgqueue) concurrently. there are 2 tables within the db(Incoming,Outgoing). these applications run 24 hours a day on a clients server. The first app uses the incoming table too insert data. The second app picks up that data from the incoming then saves to a different db and deletes from incoming, and then saves multiple copies in the outgoing table. The third app picks up the data from outgoing sends to another app via a tcp socket then deletes from outgoing. All of this works perfect during the day, but once I leave and come back the next morning the third app is stuck sending messages and will not delete fro outgoing. Note that I close the recordset after every connect. So I try and repair the table and i get some errors like delete file is outside of datafile and operation failed. So I stop and restart the mysql server and repair(works fine until the next day). Now the clients server is on a network with other servers and behind a firewall. I think the problem maybe if they restart the server or the firewall everynight(while my apps are still running queries) then mysql is trashing the outgoing table. I have looked into(but can't figure out how to do it) trying to set the -myisam--recover, so it would check for trashed tables or db's and repair automatically. Can I do that in a query ? Maybe that is not even the problem. I have some code in the app that queries the table ("Select count(*) from outgoing") and if the recordset doesn't connect then Repair table outgoing, but that doesn't work. I know this post is like reading book but this is my last resort please help......😕