Solved

auto numbering and backups

Posted on 2009-07-12
5
153 Views
Last Modified: 2012-05-07
I am trying to add numbering to the next release of my app for Invoices, Proposals, customer numbers etc. I can put them in a database and have the database auto increment or put them into a file and have code do the increments. My app has the ability to do backups and restores. how can i be sure the numbers are valid on a restore if the customer has created new documents ?
0
Comment
Question by:isnoend2001
  • 3
  • 2
5 Comments
 
LVL 42

Expert Comment

by:dqmq
ID: 24835188
In my vernacular a restore puts everything back the way it was at the time of backup.  So, if the numbers were good when they were backed up, then they are good when they are restored.

Perhaps you mean something else.  Can you give an example of how a number might go bad?
0
 

Author Comment

by:isnoend2001
ID: 24835439
My app produces roof estimates that are saved as a random access file. When saved it saves roofprice, and a lot of other information including document numbers
Example:
 Backup Invoice number is 5500
User creates more invoices current number is now 5510
customer does a restore Number is put back to 5500
This means that 10 numbers have been used
0
 
LVL 42

Expert Comment

by:dqmq
ID: 24837107
It's the responsibility of the Restore process to sync everything up.  If you are restoring backward in time, then you need to delete the invoices created after that point to remain in sync.   If you want to roll foward to a point in time, then you need to update the counter to that point in time.  These are the sort of things databases do extremely well and with a mimimum of fuss.  You are at a disadvantage storing your estimates in random access files.  

You might consider keeping a database cross-reference to your random access files.  
0
 

Author Comment

by:isnoend2001
ID: 24837298
In my situtation is is not feasible to storethe random access  data in a database. I random access is i estimate and contains upto 5 richtexboxs, wirth pictures, 8 mshflexigrid data and many more objects. I have found that database is not the place to store objects. I have desided to do this: On the restore check
if the numbers are less on the file to restore. The file looks like this:
Bid Number=1001
Proposal Number=2001
Change Order Number=4001
Invoice Number=3001
Certificate Number=5001
Not restore the file if the numbers are the same
0
 
LVL 42

Accepted Solution

by:
dqmq earned 500 total points
ID: 24840388
> I have found that database is not the place to store objects.
 
DB's are getting better, but I won't dispute that.  On the otherhand, databases are good for storing a cross-reference to the files and the relationships between them.  For example, you might have a Bid table that merely contains the bid number, status, and the path to the file where the bid is stored.  That way, the next bid number is always max(BidNo) +1.  

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question