Jump to content

Create a blank database


Recommended Posts

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!

Link to comment
  • 2 weeks later...
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)... :shifty:

Download File:post-457-1117614276.zip

Link to comment
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)... :shifty:

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

Link to comment
  • 2 weeks later...

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.