Primary Key Violation

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Primary Key Violation

    Hello,

    I have a database that has a primary key for username.
    I'm using an ASP page to allow people to register on line,
    I have username set as primary key. When they try to
    click to add theirselves to the db through the ASP page,
    they receive an error - primary key violation. Is there a
    friendly way to tell them they cannot add their record
    because a username already exist before the SQL Server
    message occurs?

    James
    James Guest

  2. Similar Questions and Discussions

    1. Primary Scratch & Windows Primary Paging file?
      Okay, I accidentally uninstalled Adobe Photoshop the other day. So I re-installed it and now when I click on the Photoshop Icon and it starts to...
    2. access violation
      I am forced to try to print from an old 16bit vb(3?) program. When attempting to print to pdf, i recieve the following error: ....caused an access...
    3. HELP ACCESS VIOLATION
      System: Windows 2003 Server PHP 5 Final IIS 6 Problem: Every time I run a PHP page I get "PHP has encountered an Access Violation at...
    4. Add primary key
      Hello Barney, "Barney" <anonymous@discussions.microsoft.com> schrieb im Newsbeitrag news:ECCDAF82-099F-4DBE-82A2-FB4F38E9F6DE@microsoft.com... 5,...
    5. Get Primary Key
      How do I get the primary key of a record just enter into the database? Then pass that same primary key ID column value to another table? Example:...
  3. #2

    Default Re: Primary Key Violation

    [url]http://www.aspfaq.com/2509[/url]

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)




    "James" <anonymous@discussions.microsoft.com> wrote in message
    news:1ff5201c45897$393b9a90$a501280a@phx.gbl...
    > Hello,
    >
    > I have a database that has a primary key for username.
    > I'm using an ASP page to allow people to register on line,
    > I have username set as primary key. When they try to
    > click to add theirselves to the db through the ASP page,
    > they receive an error - primary key violation. Is there a
    > friendly way to tell them they cannot add their record
    > because a username already exist before the SQL Server
    > message occurs?
    >
    > James

    Aaron [SQL Server MVP] Guest

  4. #3

    Default Re: Primary Key Violation

    James wrote on 22 jun 2004 in microsoft.public.inetserver.asp.db:
    > I have a database that has a primary key for username.
    > I'm using an ASP page to allow people to register on line,
    > I have username set as primary key. When they try to
    > click to add theirselves to the db through the ASP page,
    > they receive an error - primary key violation. Is there a
    > friendly way to tell them they cannot add their record
    > because a username already exist before the SQL Server
    > message occurs?
    >
    sql="select ... where username = " & request.form("username")
    mDATA=cnct.execute(sql)
    if not mDATA.eof then response.write "you are known already"

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139