Strange uniqueidentifier behavior in adp

  • Thread starter Thread starter Frank Gordon
  • Start date Start date
F

Frank Gordon

Hi,

I use an adp with acc2002 / sql2k. In a table I have a uniqueidentifier as
primary key and several foreign keys which are also of type
uniqueidentifier. The pk is generated via NEWID() as default. Strange thing
is that whenever you insert a new recordset the foreign keys are also
defaulted with new uniqueidentifier values. As a test, I deleted the NEWID()
default of the primary key but a new value is still generated for all
uniqueidentifier columns in the table. Just to be sure I created a completly
new table with two uniqueidentifiers, one the pk with no NEWID(), and a
dummy nvchar data field. Whenever I insert data into the dummy field new
uniqueidentifiers are automatically created. There are no defaults,
triggers, relationships etc. When I use the Enterprise manager to insert
data, the behavior of the tables is normal, e.g. only uniqueidentifiers with
a default NEWID() are created the others are left blank as should be. This
is really annoying as it compromises data integrity with related tables. Any
ideas / solutions ??

Thanks

Frank
 
Hello again,

to look further into the issue I now created an unbound form in access and
wrote the values into the table via ado. In that case only NEWID() defaulted
uniqueidentifiers are generated as should be. So the described problem
occurs only if bound forms are used or data is inserted into the tables
directly when in dataview.
As another test I created a new access-only database (.mdb) with a table
with replication-ids. The strange behavior does not occur there, that is
those ids are only generated if set to AutoValue. I am at a loss here...

Regards,

Frank
 
Back
Top