Unique key and error trapping?

Results 1 to 2 of 2

Thread: Unique key and error trapping?

  1. #1
    elaine pack Guest

    Default Unique key and error trapping?

    I have a non-traditional ODBC database on which I use a standard Insert/Update SQL statement to add to or update records. I need a unique key for the db, of course, and had been using the viewer&#039;s Social Security Number, which was working fine. However, my user has just changed my specs so that I can no longer use the SSN as any part of the key. This is not an Access or SQL Server db, as noted, so it will not automatically generate a key for me.<BR><BR>Can anyone suggest any ways to create a unique key in a situation like this? <BR><BR>It has been proposed that we could maintain a separate "key file" on which we track the key of the last record written and add 1 to it each time we write a new rec. If we get a dup error, we would continue to increment that number until it "hits". <BR><BR>The problem with this, tho, is that I don&#039;t know how to check for a duplicate record in my .asp program! Right now it just fails with a generic "duplicate key" message in the browser. I can easily check for EOF on a read ("if rs.eof then..."), but how do you programatically check for errors on a write? Is there a SQL statement that can do this?<BR><BR>TIA<BR><BR>elaine pack<BR>epack@blue.unix.virginia.edu<BR>

  2. #2
    elaine pack Guest

    Default RE: Unique key and error trapping? - forget error

    I have done some more research here and think I&#039;ve got a handle on the error trapping portion of my question, but the question about generating a unique key is still valid.<BR><BR>elaine pack<BR>epack@blue.unix.virginia.edu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts