Sunday, March 25, 2012

Access Data Projects Uniqueidentifier problem

Hi,

I am designing a SQL server backend, MS Access (ADP) frontend
application and I came across an interesting problem.
Lets say I have a table T with the following fields(columns)
[a] (int Not Null, Primary key, Identity auto increment)
[b] (uniqueidentifier, Allow Nulls)
[c] (text)

When I open the table in datasheet view using Access and type a value
in [c], [a] and [b] get populated automatically. [a] getting filled
with incremental integers is understandable. But, I have not set the
ISRowGUID or a default value for [b] and still it gets popullated with
a random GUID. If I use SQL Server enterprise manager to enter data
into the table T, [b] does not get filled and stays Null. I forgot to
mention that there are no relationships between the tables yet.
Is it MS access that is responsible or is it me? In any case can
something be dont to prevent this? Also should there be something else
in relation to this that I have to look for in the future.

My best
Ibrahim MMSSQL itself won't put in a value unless you have a column default or a
trigger on the table, so it seems likely that Access is doing this. You
could use Profiler to see exactly what commands Access sends to the
server when you use the datasheet, but if you want to know why it does
that, then I guess you'll get a better answer in an Access group.

Simon|||Thanks Simon,

The "problem" in fact does lie in MS Access.

I found a fix here
http://www.developersdex.com/sql/me...p=581&r=3822184

Thanks a lot for all the help !
My best
Ibrahim M

No comments:

Post a Comment