Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create GUID Autonumber programmatically in ms access

Tags:

c#

ms-access

How do I create guid autonumber field programmatically using C#?

like image 793
Baris Avatar asked Sep 05 '25 03:09

Baris


2 Answers

In order to make your GUID field auto-increment, use GenGUID() as it's default value.

This works in Access using ADO. Perhaps a similar statement will work in C#:

CurrentProject.Connection.Execute "CREATE TABLE hede (Id Guid DEFAULT GenGUID())"
like image 189
HansUp Avatar answered Sep 11 '25 06:09

HansUp


This might be helpful:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q180841

Also, using DAO:

What is the MS Access SQL syntax to create a field of type Hyperlink?

like image 26
Jerome Avatar answered Sep 11 '25 04:09

Jerome