Zeroes in my DB

Results 1 to 3 of 3

Thread: Zeroes in my DB

  1. #1
    Join Date
    Dec 1969

    Default Zeroes in my DB

    Hi,<BR><BR>I am adding a telephone number to my database and it works except that if the number was for example 019827 the db would add 19827 and delete the 0. This only happens id the 0 is at the beginning. Please help.<BR><BR>Martin.

  2. #2
    No - No - No Guest

    Default *** CROSS POST ***


  3. #3
    Mike H. Guest

    Default RE: Zeroes in my DB

    Hi Martin,<BR>I am assuming (I know, a stupid thing to do) that you are entering the phone number on a HTML form. You can change the db to make the phone number something like char 6 (6 character field, if that is the case), instead of an integer or long. You rarely have to do any computations with a phone number so there is no reason to make it an integer. Then when you process the form, you can do the following:<BR>if len(request.form("phonenum") = 6 then<BR> recordSet("phone") = request.form("phonenum")<BR>elseif len(request.form("phonenum") = 5 then<BR> recordSet("phone") = "0" & request.form("phonenum")<BR>elseif len(request.form("phonenum") = 4 then<BR> recordSet("phone") = "00" & request.form("phonenum")<BR>...<BR>end if<BR><BR>Mike

Posting Permissions

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