473,408 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Back up

I am using vb6 and access and making an accounting software. How to code for back up...Pleae give me some idea
Feb 24 '08 #1
4 1142
jagged
23
I am using vb6 and access and making an accounting software. How to code for back up...Pleae give me some idea

Just copy the file to another directory or with another when your program exits, after you've closed all connections to the database...

FileCopy app.path & "\mydb.mdb", app.path & "\mydb_backup.mdb"

or use the FileSystemObject
Feb 24 '08 #2
Killer42
8,435 Expert 8TB
We often have questions here asking "how do I do a backup?". But the question is not as simple as it seems.

The first thing to do is work out what sort of backup strategy you want to follow. Things like what sort of backup (copy a whole database, copy selected records, incremental backup, etc etc), how often, where from, where to, how many copies, and so on. The technical details of how to do it are a comparitively minor consideration. The "where, why, how often" and so on will depend on the business, the type of data, the frequency of updates, and all sorts of factors.
Feb 25 '08 #3
debasisdas
8,127 Expert 4TB
A couple of months back i have posted a reply to such a question with VB code . Try to find that .
Feb 25 '08 #4
Hi,

The above code will show an error if the mdb you are trying to copy is opened ... You can try the below code which allows copying the mdb file though it is open...
Expand|Select|Wrap|Line Numbers
  1. Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" _
  2. (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, _
  3. ByVal bFailIfExists As Long) As Long
  4.  
  5.  
  6. Private Sub Command1_Click()
  7. Dim lngResult As Long
  8.     Dim lngError As Long
  9.     Dim strSource As String
  10.     Dim strTarget As String
  11.  
  12.     strSource = "C:\test\1\Emp.mdb"
  13.     strTarget = "C:\test\1\2\Emp.mdb"
  14.     lngResult = CopyFile(strSource, strTarget, lngError)
  15.     MsgBox "Succesfully Copied to - C:\test\1\2"
  16. If Err Then
  17. MsgBox "Cannot copy", vbCritical
  18.  
  19. End If
  20. End Sub
Feb 25 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
1
by: Peter D. Dunlap | last post by:
Hello, I realize that this may not be the best place to ask this question, through the application is asp.net. I also realize that questions about disabling the back button are generally met...
4
by: Hypo | last post by:
I added a 'Back' button to my page, and wrote 'OnClick' code something like this: Response.Write("<script>history.go(-" + iDepthIndex.ToString() + ");</script>"); But, it dosnt work! Effect...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
29
by: Tom wilson | last post by:
I can't believe this is such an impossibility... I have an asp.net page. It accepts data through on form fields and includes a submit button. The page loads up and you fill out some stuff. ...
8
by: rdemyan via AccessMonster.com | last post by:
Anyone have any ideas on how to determine when the back-end file (containing only tables) has been updated with new data. The date/time of the file won't work because it gets updated to the...
5
by: The alMIGHTY N | last post by:
Hi all, Let's say I have a simple math formula: sum (x * y / 1000) / (sum z / 1000) I have to do this across 50 items, each with an x, y and z value, when the page first loads AND when a...
4
by: bendlam | last post by:
I have a page that contains search criteria and when you click on the search button it causes a post back that populates a dataview on the same page. One of the gridview columns contains a link...
12
by: jim.richardson | last post by:
Hi all, I'd like a page to be excluded from the back button history, that is, when a user hits their browser's back button, it never backs into this particular page. Can anybody please tell...
22
by: Rickster66 | last post by:
As Instructed this is a new thread regarding my original post: "Select Only 10 Columns Going Back" I'm sorry for the late response. I've been gathering up information and carefully with as much...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.