string comparison and increments

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

  1. #1

    Default string comparison and increments

    on our work registration system we use the first part of the email
    address (eg. john.smith) as the username for the registrant, the user
    has no choice of username.

    When a user register I want to determine if the username already exists
    in the db and if it does, modify the username so it will be unique.
    I want to modify the username by adding a number on the end. How do I do
    this?
    note: There are a number of domains in use at work so cannot always
    guarentee username uniqueness

    I was thinking i would have something like:

    varEmailUserName = request.form(FirstPartOfEmailAddress)
    varEmailUserName = john.smith 'for example

    strsql="SELECT loginid FROM Users WHERE loginid LIKE
    '"&varEmailUserName&"'
    set rs=conn.Execute(strsql)
    If rs.bof and rs.eof then
    'unique username will be available
    else
    'username will exist
    'how do i manipulate john.smith to john.smith1
    'also john.smith1 must be unique
    end if

    all help greatfully received
    cheers
    matt

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    matt ahorn Guest

  2. Similar Questions and Discussions

    1. #40115 [Bgs->Csd]: String Comparison shows odd results for integer values around -2^31
      ID: 40115 User updated by: jannisbreitwieser at web dot de Reported By: jannisbreitwieser at web dot de -Status: ...
    2. #39084 [NEW]: string casting and comparison with ==
      From: stevebird at gmx dot de Operating system: PHP version: 5.1.6 PHP Bug Type: Strings related Bug description: string...
    3. String replace and comparison
      Hi, I am trying to replace the accented character in a string and compare with the standard string. This code is not working. Could you please help...
    4. String Comparison
      im having trouble comparing two strings togeather. this code always returns false. please help!
    5. String Comparison Confusion
      Hi, can someone please explain why the line puts "YES" if x == 0 returns nil? Does ruby convert x to a fixnum or convert 0 to a string? Either...
  3. #2

    Default Re: string comparison and increments

    Aaron & Ray

    cheers for the advice. It's a registration system for intranet
    application, it's just that i work for a large company that uses at
    least 5 email domains. the actual application locks out accounts after 3
    invalid logins, so not too fussed if people know other logins...

    cheers
    matt



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    matt ahorn 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