|
-
December 11th, 2002, 06:02 PM
#1
how to get a unique INT value in C++?
I just want to get a unique INT value to assign it to every record in database as primary key, any API can do it? Any related information is appreciated.
-
December 11th, 2002, 06:23 PM
#2
a unique INT? You mean through different app-starts?
You can store Your value in the registry or in an ini-file and increment it.
Hope this helps
Mikey
-
December 11th, 2002, 07:54 PM
#3
May be CoCreateGuid() or UuidCreate() or UuidCreateSequential() suite your needs. These are usually used for generating a unique 128-bit integer in M$ plaftorms.
-
December 11th, 2002, 11:42 PM
#4
Why not just use an autonumber field in the database???????
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|