[AccessD] Acc97: Creating GUID Autonumber using VBA code...

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Mon Feb 10 12:40:00 CST 2003


Charlotte,

It wrote Autonumber not "autoincrement" - and I tried to use dbAutoIncrField
attribute just by analogy because this is a an attribute, which marks dbLong
as Autonumber...

> but I wasn't aware you could assign
>  a default value to it
You can assign to a field programmatically all of the properties you see on
General tab of a table design view and more...

But what they (MS) do to create Autonumber GUID is still a puzzle for me...

Anybody knows the answer?

TIA for any additional info,
Shamil

----- Original Message -----
From: "Charlotte Foust" <cfoust at infostatsystems.com>
To: <accessd at databaseadvisors.com>
Sent: Monday, February 10, 2003 7:39 PM
Subject: RE: [AccessD] Acc97: Creating GUID Autonumber using VBA code...


> Can you create a GUID like that?  I know you can create the field, but I
> wasn't aware you could assign a default value to it, and I didn't think
> there was any such thing as "autoincrement" for GUIDs because they're
> supposedly unique by definition and aren't meaningful data anyhow.  I
> haven't worked with them in several years but when I did I found them
> pesky creatures that pretty much did as they pleased.
>
> Charlotte Foust
>
> -----Original Message-----
> From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru]
> Sent: Friday, February 07, 2003 6:15 AM
> To: AccessD
> Subject: [AccessD] Acc97: Creating GUID Autonumber using VBA code...
>
>
> Hi All,
>
> Is the subj described somewhere? Should I RTFM with more attention and
> accuracy? The following code doesn't produce desired result:
>
>     Dim dbs As DAO.Database
>     Dim tdf As DAO.TableDef
>     Dim fld As DAO.Field
>
>     Set dbs = CurrentDb
>     Set tdf = dbs.TableDefs("tblTest")
>     Set fld = tdf.CreateField("fldTest", dbGUID, 16)
>     fld.Properties("DefaultValue") = "GenGUID()"
>     tdf.Fields.Append fld
>
> dbAutoIncrField value for Attributes property can't be used at all
> producing error 3001 - Invalid argument Any solutions?
>
> TIA,
> Shamil
>
> --
> e-mail: shamil at smsconsulting.spb.ru
> Web: http://www.smsconsulting.spb.ru/shamil_s
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list