home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!emory!ncratl!hroth
- From: hroth@ncratl.AtlantaGA.NCR.COM (Harris Roth)
- Newsgroups: comp.databases
- Subject: Re: Yet Another Simple (?) Question on Paradox
- Keywords: Unique Record Field, Paradox
- Message-ID: <8966@ncratl.AtlantaGA.NCR.COM>
- Date: 4 Sep 92 14:31:08 GMT
- References: <1992Aug31.195806.13243@murdoch.acc.Virginia.EDU>
- Distribution: na
- Organization: NCR Engineering and Manufacturing Atlanta -- Atlanta, GA
- Lines: 29
-
- In article <1992Aug31.195806.13243@murdoch.acc.Virginia.EDU> cyj9h@csissun12.ee.Virginia.EDU (Charles Y. Choi) writes:
- >Here's a question that I've yet to figure out. When creating a new record,
- >how can you get a field in that record (say ID) to automatically be filled
- >in with the record number? For example
- >
- >So what do I want? All I really want to do is have an automated
- >way of generating a unique ID for each record period.
- >
- >Can anybody here help?
- >
- >-Charles Y. Choi
-
- If Nrecords( "Table") = 0 Then ; no records yet?
- id = 1 ; first id
- Else
- id = Cmax( "Table", "ID") + 1 ; largest id + 1
- EndIf
-
- This will guarantee a unique id for each record regardless of the number
- of records added or deleted. There will be not be a coordination between
- the record number and the ID but, why do you need that anyway?
-
-
-
- --
- Harris J. Roth, Senior Programmer Analyst |
- System Software | hroth@ncratl.atlantaga.NCR.COM
- Transaction Terminal Systems Division |
- NCR E&M Atlanta |
-