PC Review


Reply
Thread Tools Rate Thread

UniqueConstraint error: "These columns don't currently have unique values"

 
 
Timo
Guest
Posts: n/a
 
      26th Aug 2003
I set up an alternate unique composite index in Access2000 using the
indexing dialog:

AltUniq: MyTable.ColumnA
MyTable.ColumnB

Primary: No
Unique: Yes
IgnoreNulls: No (NOTE: have also tried Yes here)

The columns are Text. ColumnA is required and does not allow zero-length
strings. ColumnB is not required and does allow zero-length strings.

This is equivalent to creating a unique index on (ColumnA, ColumnB).
Access doesn't complain, which means Access regards the column
combination as satisfying the uniquness test after scanning the data.
Access accepts the index when IgnoreNulls = No and when IgnoreNulls=Yes.

However, ADO.NET gives me the error in the subject line, namely that the
columns violate uniqueness. Googling, I've seen people reporting this
error when setting up relations.

Here's my code:

Dim ConstraintCols As DataColumn() ' for multi-column uniqueness
ConstraintCols = New DataColumn() {T.Columns("ColumnA"), _
T.Columns("ColumnB")}
Dim uc As UniqueConstraint = New UniqueConstraint("MyConstraint",
ConstraintColumns)
Dataset.Tables(MyTableName).Constraints.Add(uc)

Grateful for any tips/suggestions.
TIA
Timo
P.S. Cross-posted to Access in case someone there has helpful info on
the Access side of the issue.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Summing unique values (where "unique" depends on multiple criteria") Harry Flashman Microsoft Excel Discussion 4 19th Dec 2009 05:03 AM
union query with "unique" and "is not null" values Mark Kubicki Microsoft Access Form Coding 1 3rd Jun 2009 04:35 PM
Datable relationship error "columns don't currently have unique values" j-in-uk Microsoft C# .NET 2 15th May 2006 09:32 PM
"These columns don't currently have unique values" web1110 Microsoft C# .NET 0 20th Nov 2004 03:31 AM
UniqueConstraint error: "These columns don't currently have unique values" Timo Microsoft Access 0 26th Aug 2003 07:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:19 PM.