Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

generating unique ID for use in a call logging system

Status
Not open for further replies.

kiwieur

Technical User
Apr 25, 2006
200
0
0
GB
Hi Guys,

I am pretty new to ASP so please forgive me if my question sounds a bit "dumb". We have a basic intranet at work which I adminster, at the moment it is pretty much all HTML with pages that just show information etc plus links to some documents.

I have been asked to see if i can come up with a call logging system for internal use, the data will be stored in an Access database and I am trying to find a way that when the user wants to add a new record the call number ID will be
a)Unique
b)Sequential

My problem is that I know that it may be possible for 2 users to do this at the same time and therefore generate duplicate ID's. I was thinking along the lines of this scenario

1) User opens web page which generates the Call ID, they then submit this to the DB and are then returned to another page with the ID already filled in where they can then enter the rest of the data before updating the record.

Does this sound plausible ?, if so is there anyone that would be kind enough to help me achieve this please


Regards

Paul

 
It is important to assign/reserve the ID immediately? Is the ID important in some other way than as a primary key for calls (does the ID number have meaning-date or something)?

Couldn't User 1 open the data collection page, enter information, and hit submit, while User 2 is doing the same thing on a different call? Then they just get an Access autonumber in the order they hit the database (INSERT). No duplicates.

If this is exclusively internal and everybody can see the same server, you might could do it as an Access application instead of using a browser and ASP?
 
Hi BigRed1212,
Thank You for your reply, since posting the question I have come up with the following scenario.

User clicks on link and it takes them to a page where I have a form that uses the following code

Code:
SELECT MAX(GenerateID)+1 AS MaxId
FROM tblGenerate

and a submit button, therefore all they have to do is hit submit, once this is done I have a redirect to the page where the call ID is called from the "generated table" and placed in the form automatically they can then enter the rest of the information.Once they have done this they then submit the data to the main table.

The reason for not having this in an access application is the fact that not all the user MS have access on their PC's but of course they do all have a web browser, and the end result should be pretty similar if I can get it right.

I know we could probably compile an MDE but as I am the only one with this skill it would leave us vunerable if i'm not around, however there is 2 of us that know a liitle about HTML etc.

Once again thank you for your reply, do you think what I have in place might work ?

Regards

Paul

 
I guess I still don't see why you need to generate the ID first.

User gets call.
User goes to ASP call log page.
User enters data from caller and whatever.
User submits information.
Data is inserted into database and ID number is auto assigned.


If users rework previous calls it might be more like:
User gets call.
User goes to call log page.
User determines if cller has called before.
If not, follows above procedure.
If so, searches for a caller by data, name, whatever.
Data is selected from database populating screen.
User enters/corercts data from caller and whatever.
User submits information.
Data is updated into database.

If you need/want to read the caller back their ID number or something, then write it back to a closeout screen after the call information hits the database.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top