Serial numbering of documents in a networked environment

D

DoctorG

I would like to know the recommended method of inserting an automatic
"serial" number in a document. An example of this would be a company-wide
outgoing fax serial number.
I realize that it is rather big, in the sense that it could include many
issues (what kind of field should be used, how do we keep the user from
altering it and so on).
Since I have a background in DOS programming, I am primarily interested in
the file functions and locking mechanism necessary to save and retrieve the
serial number from an external file, since we are operating in a networked
environment.
Any help is welcome. Thanks in advance.
 
H

Helmut Weber

Hi,
as nobody else seems to be concerned with this,
I'd say, even in a medium scale network I would
not try to do things like that using VBA.
Should be possible using VB, though.
I'd suggest, to use a low level, simple to maintain,
real database program, like Lotus Approach,
which is serving a similar job here for about
50 users and has done so for 7 years.
Occasional crashes included, of course.
If you really want to do it yourself,
http://msdn.microsoft.com/newsgroups/default.aspx?
dg=microsoft.public.vb.database&lang=en&cr=US
may be the right place to start with.

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
D

DoctorG

Helmut,

Is it possible for you to explain to me how a database program would manage
what I need?

Furthermore, it would be quite easy for me to write a piece of code, in
Clipper for example, and loop until a DOS file containing the serial number
becomes available, iterate it and save it back again. By the way, can you
tell me how I should call such a program from the "Save File Event
Procedure", in order to pass parameters to and from DOS?

Greetings from Athens, Hellas
 
H

Helmut Weber

Hi,
I am really no good at this. It wouldn't be a problem,
to create a text file, at a place accessible to all users,
keep nothing but a number in it, read the file,
increment the number, write the new number back
and save the file. The question is,
how to handle attempted simultaneous access by many users.
As every database engine takes care of this,
an ordinary programmer leaves it to the database.
The database locks the record, but it isn't that simple.
---
For the most simple workaround, I'd use VBA to
rename the file first, so that it is not accessible
to other users, read the number, write the number, etc.
and rename the file back. So, in case of a simultaneous
access, other users but the actual user, will get an
error, which could be processed, like waiting for 1
or 2 seconds, which should be quite enough, and try again.
---
HTH
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
D

Doug Robbins

See the article "Creating sequentially numbered documents (such as
invoices)" at:

http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm

for a basic approach.
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top