Tim Erickson Posted May 19, 2005 Report Share Posted May 19, 2005 Hello, I am looking for the most efficient way to backup records deleted from a MS Access database to another location. This is what I have come up with so far: 1. Copy an empty database to a new location with a new name. This is the database the data will be backed up to. 2. Execute a SELECT INTO SQL statement via the ADO connection object to transfer the data from the old database to the back up database. 3. Delete the transfered data from the old database with a DELETE SQL statement via the ADO connection object. Is there a way to programatically create a blank MS Access database so I do not have to maintain a blank database somewhere? Does anyone have any improvements or another way to do this? Thanks! Quote Link to comment
osvaldo Posted June 1, 2005 Report Share Posted June 1, 2005 Hello, I am looking for the most efficient way to backup records deleted from a MS Access database to another location. This is what I have come up with so far: 1. Copy an empty database to a new location with a new name. This is the database the data will be backed up to. 2. Execute a SELECT INTO SQL statement via the ADO connection object to transfer the data from the old database to the back up database. 3. Delete the transfered data from the old database with a DELETE SQL statement via the ADO connection object. Is there a way to programatically create a blank MS Access database so I do not have to maintain a blank database somewhere? Does anyone have any improvements or another way to do this? Thanks! 4801[/snapback] Hi Tim, I have the same problem... A friend of mine, experienced C++ programmer, sent to me the attached C++ program that resolve it... This program accept on the command line the name of the empty file .MDB (without extension) to create in the current directory (also accept a full path name). It's very simple... Unfortunately, I don't know how to convert it in pure LabView, since I don't know what is the dll which contains the called function!! This little program run even if you do not have MS Access installed on the machine (tested in Windows XP/2K)... Download File:post-457-1117614276.zip Quote Link to comment
Tim Erickson Posted June 1, 2005 Author Report Share Posted June 1, 2005 Thanks, I will give it a try. Currently I am using an blank database as a template and copying it programmatically to where it needs to be. Quote Link to comment
Rolf Kalbermatter Posted June 5, 2005 Report Share Posted June 5, 2005 Hi Tim, I have the same problem... A friend of mine, experienced C++ programmer, sent to me the attached C++ program that resolve it... This program accept on the command line the name of the empty file .MDB (without extension) to create in the current directory (also accept a full path name). It's very simple... Unfortunately, I don't know how to convert it in pure LabView, since I don't know what is the dll which contains the called function!! This little program run even if you do not have MS Access installed on the machine (tested in Windows XP/2K)... 4913[/snapback] For such things, you best look at msdn.microsoft.com. The particular function is implemented by odbccp32.dll. and therfore should be easy to be called directly from within LabVIEW through the Call Library Node. Rolf Kalbermatter Quote Link to comment
Mike Ashe Posted June 13, 2005 Report Share Posted June 13, 2005 Okay, this is not an elegant solution, but rather quick & dirty, but it works for this type of problem in general, not just databases. When I have had to remake files in the past, including databases, I created a blank version of the file, in your cases a blank of your MS Access file. I usually set up the tables, etc as well. Then I make a LabVIEW VI to read in the file *AS BINARY* just using the LabVIEW read VIs, not using database VIs. I then have this VI put the file into a control, and I save the control data as default. Then add a function to rewrite the file later, again as binary. That way my LabVIEW app has the database template built inside. Simple, works. Later, I tended to make this template VI dynamically loadable, so that if I wanted I could load a different version of it, from outside the application, so that after delivery, if I wanted to update the database, etc, I could, while still holding the original inside as a factory default. Quote Link to comment
Tim Erickson Posted June 16, 2005 Author Report Share Posted June 16, 2005 Thanks Michael! Great idea! This approach opens up lots of possibilities. :thumbup: Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.