Session("customer_number") = CLng
(txtCustomerNumber.value)
(I have also tried CInt)
I get the following error: -
Microsoft VBScript runtime error '800a000d'
Type mismatch 'CLng'
/customer_search.asp, line 88
I have hardcoded a numeric value into the session
variable and the database query works just
fine. I have also put the value from the textbox
into an alert box with question marks either side
to check for hidden characters (there were none).
I am really starting to lose it with this, has
anyone got any ideas on this problem or any
suggestions on how to populate a session var from
jscript plz let me know.
TIA,
Ashley.
Sent via Deja.com http://www.deja.com/
Before you buy.
Session("customer_number") = CLng(txtCustomerNumber.value)
I get the following error returned to the browser: -
Microsoft VBScript runtime error '800a000d'
Type mismatch 'CLng'
customer search.asp, line 88
Anyone got any ideas on where I'm going wrong? Or any ideas how I
could populate the session var using JSCript?
TIA,
Ashley
> Session("customer_number") = CLng(txtCustomerNumber.value)
use CLng(Session("customer_number")) as input to your query.
Also, when setting your session variable make sure the code is on one line
or use a continuation character. I can't tell from your example if that
was actual code or you split it into two lines to fit this post. For
example the code should be:
Session("customer_number") = CLng(txtCustomerNumber.value)
OR
Session("customer_number") = CLng _
(txtCustomerNumber.value)
I recommend the first.
One last thing, I've been working with VBScript and with VB but I haven't
mixed the two. What I mean to say that on a VB form I have text boxes but
in an ASP web page I have Form <input> fields of type=text so when I want
to assign the value of what was typed in I would have:
to put the field on the page (in plain html):
<form>
<input type=text name=customer_number_input>
</form>
to assign it to a session variable in vbscript:
<%
Session("customer_number") = Request.Form("customer_number_input")
%>
to use it when calling a Query routine that needs a number value
Dim CustRecordset
Set CustRecordset = GetMasterByCustNum( CLng( Session("customer_number") )
)
Hope some of this helps.
Jerry Russell
jer...@mcsgroup.com
====================================================================================
Hi,
I'm trying to use vbscript to populate a session
variable. I am using Visual Interdev and taking
a value from a textbox, for the purpose of a
database query this must be numeric. I have
jscript code to validate input on the client to
make sure it is numeric and as far as I'm
concerned the value is numeric but the database
query fails because it is populating the session
variable with a string. I have tried to use the
following code to force the var to take a numeric
type: -
Session("customer_number") = CLng
(txtCustomerNumber.value)
(I have also tried CInt)
I get the following error: -
Microsoft VBScript runtime error '800a000d'
Type mismatch 'CLng'
/customer_search.asp, line 88
I have hardcoded a numeric value into the session
variable and the database query works just
fine. I have also put the value from the textbox
into an alert box with question marks either side
to check for hidden characters (there were none).
I am really starting to lose it with this, has
anyone got any ideas on this problem or any
suggestions on how to populate a session var from
jscript plz let me know.
TIA,
Ashley.