Dorin
Posts: 50
|
Posted: 11/18/2009, 1:11 AM |
|
Hello,
I have a simple grid with products and their barcodes and a search form. The barcodes are 13 characters lenght. If I try try to search after a barcode I get:
Microsoft VBScript runtime error '800a0006'
Overflow: 'CLng'
Common.asp, line 1540
where I have
If DataType = ccsInteger Then
Result = CLng(NumberVal)
Any clue?
thanks
|
|
|
andrewi
Posts: 162
|
Posted: 11/18/2009, 11:36 AM |
|
According to documentation, the value you pass to CLng() must be a number between -2147483648 and 2147483647. (http://www.virtualsplat.com/tips/asp-function-clng.asp). This range is likely to be exceeded by a 13 digit code (unless it has a lot of leading zeros), hence the overflow error.
If the table column that contains the barcode is numeric, then I think choosing Float instead of Integer as the Data Type of the search form text box will fix it. You may also need to change the 'Type' of the Where parameter of the Grid Data Source.
Another solution might be to put the barcode into a text column in the database, as you would with telephone numbers.
|
|
|
Dorin
Posts: 50
|
Posted: 11/18/2009, 10:49 PM |
|
Thanks for your reply...I tried this approach but I mistakenly forgot to change the search parameter from integer to text .
Now it's ok.
Best regards
|
|
|
|