|
-
Sep 19th, 2001, 06:23 PM
#1
Thread Starter
Addicted Member
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
-
Sep 19th, 2001, 06:24 PM
#2
Member
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.
-
Sep 19th, 2001, 08:22 PM
#3
I disagree I have done 'multithreading' and background or asynchronous processing before. Do a search in the forums here on either of those subjects.
-
Sep 19th, 2001, 08:24 PM
#4
Member
You can multithread WITHIN the VB IDE in apartment-style threading. But outside the IDE (i.e., compiled EXEs), multithreading is a no-no.
-
Sep 19th, 2001, 09:30 PM
#5
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.
-
Sep 19th, 2001, 11:39 PM
#6
Registered User
Edneeis is right. Createthread api fails with VB6, but active x exes are the way to successfully multithread in VB6.
-
Sep 20th, 2001, 01:06 AM
#7
Thread Starter
Addicted Member
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
-
Sep 20th, 2001, 01:22 PM
#8
Thread Starter
Addicted Member
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
-
Sep 20th, 2001, 02:28 PM
#9
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.
-
Sep 21st, 2001, 06:47 AM
#10
Addicted Member
-
Oct 24th, 2001, 04:42 PM
#11
Thread Starter
Addicted Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|