Solved

auto numbering and backups

Posted on 2009-07-12
5
152 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

831 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