The reason of the problem that your program cannot work when compiled to an exe is that you stop it if there is an error during the database connection. However, it seems that there will always be an error during the connections to your dbf file, and the error doesn't matter, because the ADO objects can still get the records successfully. So the solution is to simply comment the error checking lines, as you can see from the attached file.
And this also solves the another problem that you cannot connect the dbf file immediately after changing it.
|