navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

What is wrong with this code?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> What is wrong with this code?
Page: [1]
 
chadb

 

Posts: 485
From: Kansas
Status: offline

 
What is wrong with this code? - 9/24/2004 11:31:07   
if Request.Form("ea1")="" Then
ea1 = "0"
else
ea1 = Request.Form("ea1")
end if
if Request.Form("Qty1")="" Then
Qty1 = "0"
else
qty1=Request.Form("Qty1")
end if

and then I am donig this later

', Total1 = '" & "$" & ea1 * Qty1 & "',"

I am getting the following error

Microsoft VBScript runtime error '800a000d'

Type mismatch: '[string: " "]'

/so/sochangeall2.asp, line 373
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: What is wrong with this code? - 9/24/2004 11:43:25   
Is one of the form fields passing a blank space or something..?

Maybe try this instead:
 if Request.Form("ea1")<1 Then
ea1 = "0"
else
ea1 = Request.Form("ea1")
end if
if Request.Form("Qty1")<1 Then
Qty1 = "0"
else
qty1=Request.Form("Qty1")
end if 


Also, try changing the Qty1 to qty1 (match case)

Just in case the case is the problem... in this case.

_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 9/24/2004 12:09:06   
I changed it, now I get the same error, but on the line
if Request.Form("ea2") >1 Then

This is happening when I leave the text box blank, so it is a null sql value, right?

(in reply to bobby)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What is wrong with this code? - 9/24/2004 16:00:05   
Can you 'write' the values of both strings first to be sure what you are passing?

Youll need to convert the strings into a useable format ; eg cLng(ea1) * Qty1

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 9/27/2004 11:58:16   
I set up a page that displayed the results on 1 item. If I leave the field blank, it displays nothing, if I put a 1 in the field, it displays the one, if I hit back and delete the 1, it displays a 0 like it is suppose to. So if I load the page and the field is blank, that is when it returns nothing, does that make sense??

Thanks for the help.

(in reply to chadb)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What is wrong with this code? - 9/27/2004 14:54:25   
So - you are saying the value of ea1 and Qty is never "0" when you first press the form submit button?
Is the form passing a space character instead?

This will hopefully clarify what the form is doing

if Request.Form("ea1")="" Then
ea1 = "0"
response.write "set to 0<br>"
else
ea1 = Request.Form("ea1")
response.write "Not set to 0<br>"
end if
if Request.Form("Qty1")="" Then
Qty1 = "0"
response.write "Qty set to 0<br>"
else
qty1=Request.Form("Qty1")
response.write "Qty not set to 0<br>"
end if


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 9/27/2004 15:38:10   
Not set to 0
Qty not set to 0

(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 9/29/2004 10:32:31   
Anyone have any ideas on this??

(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 10/7/2004 10:04:29   
I am still struggling with this. Any thought? :)

(in reply to chadb)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What is wrong with this code? - 10/7/2004 10:16:30   
Whats the result when you write this?

', Total1 = '" & "$" & ea1 "-" Qty1 & "',"

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 10/7/2004 10:29:04   
Is this the right syntax?
response.write ', Total1 = '" & "$" & ea1 "-" Qty1 & "',"

(in reply to Spooky)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 11:33:57   
One thing I might add is that these fields have been written too already. The SQL value is null

(in reply to chadb)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 14:07:10   
response.write "Total1 = '" & "$" & ea1 "-" & Qty1 & "',"

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 14:24:41   
Microsoft VBScript compilation error '800a0401'

Expected end of statement

/so/changetest.asp, line 20

response.write "Total1 = '" & "$" & ea1 "-" & Qty1 & "',"
----------------------------------------^

(in reply to Spooky)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 14:26:58   
response.write "Total1 = '$" & ea1 &"-" & Qty1 & "'"

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 14:29:07   
Here is the response

Total1 = '$-'

(in reply to Spooky)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 14:36:45   
Could you post all of the page code?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 14:39:03   
Here is the post page

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
</head>
<%
response.write "Total1 = '$" & ea1 &"-" & Qty1 & "'"

%>
<body>

</body>

</html>

Do need any of the first page?

(in reply to Spooky)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 15:14:08   
Yes - I meant the actual code for the page that errors.
Also - I meant to test that code on the page that errors also! :)

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 15:21:01   
The originating page is a Form with Database results region. Here is a link I am not sure of that link will work or help out. I am testing the code in the post (action) page!??!

(in reply to Spooky)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 15:50:09   
Error Type:
Active Server Pages, ASP 0126 (0x80004005)
The include file '../_fpclass/fpdblib.inc' was not found.
/pics/sochangeall.asp, line 170
??

Can you just re-clarify what you are doing?
ie - we are working here with parts of code.
What does the code do, and at what part of the process does it error?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 16:37:30   
I will try to make it simple. I have a form with 1 text box. Wehn you submit, it does to an asp page, something like this:
Sql = "UPDATE SalesOrder SET Notes = '" & Request.Form("Notes") & "',"
sql = sql & Request.form("qty1") & "', qty2 = '" & Request.form("qty2") & "',"
& "' WHERE ID Like '" & ID & "'"

fp_conn.execute(sql)

This all works fine.

So then I have another page, which is a form that displays the text boxes with the sql data. This is an example of the text boxes:
<%=FP_FieldVal(fp_rs,"Qty1")%>


On this page, I want the emplyee to be able to update the text boxes if needed. On the submit from this page I do the same as about on an ASP page. These 2 pages are where I am having troubles. if the <%=FP_FieldVal(fp_rs,"Qty1")%> text box is left blank, that is when I get the error on the submitted ASP page. Does that make any sense?

(in reply to Spooky)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 16:47:50   
So - once the user submits the form, this code checks for blanks? The error relates to the multiplicaton of a string?

Youve tried this code?
 if trim(Request.Form("ea1"))="" Then
ea1 = 0
else
ea1 = cInt(Request.Form("ea1"))
end if

if trim(Request.Form("Qty1"))="" Then
Qty1 =0
else
qty1=cInt(Request.Form("Qty1"))
end if 


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 16:50:33   
No I will try that. By the way what does the cInt do?

(in reply to Spooky)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What is wrong with this code? - 10/11/2004 17:03:44   
Converting from a string to an integer to allow for addition

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to chadb)
chadb

 

Posts: 485
From: Kansas
Status: offline

 
RE: What is wrong with this code? - 10/12/2004 9:50:47   
OK Here is the problem now:

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'cInt'

/so/sochangeall2.asp, line 121


Line 121 is

ea1 = cInt(Request.Form("ea1"))

(in reply to Spooky)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> What is wrong with this code?
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts