Linked SQL Server Table with rowguid and identity cause cast specification error

P

pushijima

I a using SQL Server 2000 and Access 2003. I have a SQL table
published for replication. It has a uniqueidentifier column set as the
rowguid and the primary key. There is also an integer column set as an
identity column with the "not for replication" option turned on.

I have an Access application that links to this table. Inserts to this
table through Access fail with an ODBC error: "Invalid character value
for cast specification (#0)".

Through testing I have determined that if a SQL table built such as the
one I have is linked to Access and the identity column is not the
primary key, Access cannot insert into it. But if the identity column
is the primary key instead of the uniqueidentifier/rowguid column, all
is well.

Unfortunately, in my case, I cannot use the identity column as a
primary key since the "not for replication" option allows duplicate
values in the identity column.

I have further found that if I link the table to the Access mdb while
the identity column is set as the primary key (assuming the data is
compliant at the time) and then switch the primary key back to the
rowguid, the Access application can still insert properly because it
still thinks the integer column is the primary key.

Any better solutions out there? I don't trust the linked table with
the wrong primary key.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top