ljhodgett
asked on
Unique ID's in an access database using vb.net
Hi,
Like in MSSQL you can create new unique ID's using newID() is there a way to do this in an access database.
Many Thanks
Lee
Like in MSSQL you can create new unique ID's using newID() is there a way to do this in an access database.
Many Thanks
Lee
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Clarifying... If you define the field as Autonumber inside Access, any new records created through your VB.Net interface will automatically be assigned a unique number.
ASKER
With Autonumber isn't this an incrementing number for the table and not for the database as in MSSQL.
Best Regards
Lee
Best Regards
Lee
Yes. My understanding of the newID() function is that it will return a totally unique alpha-numeric "number", and it will never be repeated within that database (or on that computer?). AFAIK, Access has nothing like that. The closest is the Autonumber, which is unique for that table.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@ ragoran:
That's a great workaround!
That's a great workaround!
@mbizup:
thanks for the good word
thanks for the good word
currentdb.Execute "Alter table tableName add column newID counter"