-
Backing up and threading
Hi, I would like to back up my database my creating copies of it while my program is running.. I co worker suggested threading it in the background and use a timer to make a copy of the database ever hour or so.. He's not sure how to do this in VB since he's more of a VC++ guy.. I'm not really sure how to create threads in VB.. Can someone point me to some links? Also, anyone knows any system calls to create a copy of a file and rename to something else in the same directory?
Also, can what I'm trying to do be hidden so the user doesn't know that a back up is being made?
Thanks
John
-
Unfortunately, you can't do multithreading in VB outside the IDE. The closest thing you can do is use a timer with an Interval of 1.
-
I disagree I have done 'multithreading' and background or asynchronous processing before. Do a search in the forums here on either of those subjects.
-
You can multithread WITHIN the VB IDE in apartment-style threading. But outside the IDE (i.e., compiled EXEs), multithreading is a no-no.
-
Like I said I disagree. Using ActiveX Exs you can at least accomplish the same thing, asynchronous processing. Its all the same to the user. Check out the Coffee example.
-
Edneeis is right. Createthread api fails with VB6, but active x exes are the way to successfully multithread in VB6.
-
Thanks.. I'll have to look into Active X Exes.. Will these work if I wanted to have a infinite loop checking for the time and if 1 hr have passed, copy the mdb into a backup directory? Would this have an adverse affect on the processor?
Thanks
John
-
Hmm.. I just thought of something.. Several instances of my app will be opened at once (usually 2).. If I created this Active X exe, both instances will call it and back a back up, right? Is there a way to prevent that? Also, what is the ramifications of copying a database when data is being read or written while the copy is being made?
Thanks
John
-
If you mean their will be mulitple instances of your program running on the same computer then you could take it a step further and have all the instances use the same data/info. You could use DCOM to do this over a network as well but I haven't successfully done it over a network without installing the component on the clients.
-
test
-
Hi, I'm trying to put together an Active X EXE.. One thing, how do you refer to the path of where that Active X Exe is in? I tried app.path, but for some reason, it returns the path where the Active X exe was compiled to.. If I copy it to another directory, it returns the path that it was compiled to..
Thanks in advance.
John