SQL Numeric (9) - asp convert.

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

  1. #1

    Default SQL Numeric (9) - asp convert.

    Hi;

    The primary key in a table (SQL Server 2000) is: Numeric (9).

    Previously in our code the Primary key was INT but we decided to change
    it to numeric and now I can not get the code to work.

    How can one change a variable in ASP to NUMERIC datatype?

    I have tried:

    VARTYPE (Field) and I get 14 as the output.

    I have tried converting it to CLng or any other combination and I keep
    getting:

    Microsoft VBScript runtime error '800a000d'
    Type mismatch:

    Searching all over MSDN or the usergroups has returned no

    I can imagine this should be a common problem but I can not find any
    conversion functions to convert a variable to numeric (9) in ASP.

    Any help is greatly appreciated.

    Regards,

    Regards,
    Kami

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

  2. Similar Questions and Discussions

    1. arrays: howto convert assoc to numeric
      Folks, If I have a numeric array similar to the following: $tmpArray="alpha"; $tmpArray="beta"; $tmpArray="charlie"; I can break it down...
    2. Convert a Byte value to Numeric - Possible?
      Among the usual suspects: 1. Asc requires (apparently) an ansi value as argument. I'm dealing with the HO bits in a byte. 2. Cint requires a...
    3. How to Convert a Byte to its Numeric Value?
      I need access to the bits of a Byte expression, and the logical functions operatge bit-wise on numeric vales - per the VBScript CHM. So how do I...
    4. how to convert all invalid UTF-8 sequences to numeric equivalent?
      Hey folks, I've been grappling with this for days, and can see no option but to use brute force. We have a ton of text files from all over the...
    5. How to convert timestamp values to numeric (SQL70)
      Pedro, How big is your numeric value? It sounds like an outside of range problem. Timestamp is 8 bytes, which means a pretty big number as a...
  3. #2

    Default Re: SQL Numeric (9) - asp convert.

    try doing a

    for each field in rs.fields
    response.write field.type & "<br>"
    next

    to see what field type we are reeally talking about here

    also, try cdbl instead of clng



    "Kami" <anonymous@devdex.com> wrote in message
    news:OTefqPZmDHA.424@TK2MSFTNGP10.phx.gbl...
    > Hi;
    >
    > The primary key in a table (SQL Server 2000) is: Numeric (9).
    >
    > Previously in our code the Primary key was INT but we decided to change
    > it to numeric and now I can not get the code to work.
    >
    > How can one change a variable in ASP to NUMERIC datatype?
    >
    > I have tried:
    >
    > VARTYPE (Field) and I get 14 as the output.
    >
    > I have tried converting it to CLng or any other combination and I keep
    > getting:
    >
    > Microsoft VBScript runtime error '800a000d'
    > Type mismatch:
    >
    > Searching all over MSDN or the usergroups has returned no
    >
    > I can imagine this should be a common problem but I can not find any
    > conversion functions to convert a variable to numeric (9) in ASP.
    >
    > Any help is greatly appreciated.
    >
    > Regards,
    >
    > Regards,
    > Kami
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Jeff Clark Guest

  4. #3

    Default SQL Numeric (9) - asp convert.

    It might help if you were a little more specific about
    what "can not get the code to work" means.

    FWIW ASP is not strongly typed like SQL and other
    languages are. It is not necessary (in fact you can't) to
    declare the type of each variable. ASP will attempt to
    infer its type from the value you store in it.

    For example:
    x = 3
    ASP knows that is an integer type
    y = 13.9
    ASP knows that is a decimal type
    z = "Fred"
    ASP knows that is a string.

    However, when manipulating data, ASP can not always
    determine exactly what the types should be.

    Using the example above:
    a = x + y
    ASP will convert the integer value in x to a decimal value
    and store 16.0 in a.
    However,
    b = x + z
    will return an error because ASP can not add a string and
    a number.

    HTH
    John



    >-----Original Message-----
    >Hi;
    >
    >The primary key in a table (SQL Server 2000) is: Numeric
    (9).
    >
    >Previously in our code the Primary key was INT but we
    decided to change
    >it to numeric and now I can not get the code to work.
    >
    >How can one change a variable in ASP to NUMERIC datatype?
    >
    >I have tried:
    >
    >VARTYPE (Field) and I get 14 as the output.
    >
    >I have tried converting it to CLng or any other
    combination and I keep
    >getting:
    >
    >Microsoft VBScript runtime error '800a000d'
    >Type mismatch:
    >
    >Searching all over MSDN or the usergroups has returned no
    >
    >I can imagine this should be a common problem but I can
    not find any
    >conversion functions to convert a variable to numeric (9)
    in ASP.
    >
    >Any help is greatly appreciated.
    >
    >Regards,
    >
    >Regards,
    >Kami
    >
    >*** Sent via Developersdex [url]http://www.developersdex.com[/url]
    ***
    >Don't just participate in USENET...get rewarded for it!
    >.
    >
    John Beschler 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