Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

auto numbering and backups

Posted on 2009-07-12
5
Medium Priority
?
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

609 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