1

Topic: Violation of Primary key

I've found a little on this at http://forums.nbn.org.uk/viewtopic.php?id=4926 but not a solution I can comprehend.
I've a new copy of R6 using SQL Server 2008.
I've popped all my saved surveys in and successfully started a new one.
When I come to add a new Location I get the following error message:

date/time         : 2014-02-11, 16:39:31, 842ms
computer name     : SUMNER-PC
user name         : Darwyn
registered owner  : Darwyn
operating system  : Windows 7 Tablet PC x64 Service Pack 1 build 7601
system language   : English
system up time    : 9 hours 12 minutes
program up time   : 6 minutes 9 seconds
processors        : 4x Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
physical memory   : 11137/16078 MB (free/total)
free disk space   : (C:) 48.56 GB
display mode      : 1920x1080, 32 bit
process id        : $1e68
allocated memory  : 65.23 MB
command line      : RecorderApp.exe /133792
executable        : RecorderApp.exe
exec. date/time   : 2012-01-25 10:03
version           : 6.17.2.251
compiled with     : Delphi 7
madExcept version : 3.0n
callstack crc     : $c64527e1, $b95cc7bd, $b95cc7bd
exception number  : 7
exception class   : EDatabaseError
exception message : Violation of PRIMARY KEY constraint 'PK_LOCATION'. Cannot insert duplicate key in object 'dbo.LOCATION'.

How do I fix this please?

2

Re: Violation of Primary key

Have you run the Last Key Update addin Darwyn? The table that records which was the last key used on each table does sometimes get out of sync. Not sure why that should occur, or why the update couldn't run at startup, or weekly, but that's the way it is.

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

3

Re: Violation of Primary key

Thanks Rob, I've tried that now but I get an error message "The specified file is not a COM server and cannot be registered"

4 (edited by Darwyn Sumner 12-02-2014 19:04:36)

Re: Violation of Primary key

A lot of hunting around and I found the fix for this at http://forums.nbn.org.uk/viewtopic.php?id=2926
With so many backups of old systems kicking around in archives on various local and external hard drives I'd got the true location of the Addins folder wrong.
A quick look at the Registry (type regedit in the Start menu but try to avoid changing anything). Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Dorset Software\Recorder 6 and you'll see an entry "Addin Path" which tells you where your addins belong and tells Recorder where to look for them.
It's been a long time since I've opened that thing.

5

Re: Violation of Primary key

Oh I am in there all the time Darwyn. Every time we install Recorder on a new machine something goes into the registry wrongly. I can do it with my eyes closed now.

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre