Solved

auto numbering and backups

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now