Ask a Question related to ASP Database, Design and Development.
-
Kami #1
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
-
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... -
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... -
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... -
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... -
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... -
Jeff Clark #2
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
-
John Beschler #3
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
(9).>-----Original Message-----
>Hi;
>
>The primary key in a table (SQL Server 2000) is: Numericdecided to change>
>Previously in our code the Primary key was INT but wecombination and I keep>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 othernot find any>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 canin ASP.>conversion functions to convert a variable to numeric (9)***>
>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



Reply With Quote

