Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 27th, 2004, 01:45 PM
XXL XXL is offline
Authorized User
 
Join Date: Dec 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Image imput button

I tried to change the standard submit button with an image button but now the code doesn't work anymore.
Anybody know how could I fix this?

 
Old December 28th, 2004, 01:20 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Can you paste the code so that we can get more clear idea of error.

Om Prakash
 
Old December 29th, 2004, 12:40 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

mmm, a bit hard without the code. One way would be:
<a href="#" onClick="submitForm();"><img src="someName.gif"></a>

And another:
<input type="image" src="imgName.gif">


Wind is your friend
Matt
 
Old January 5th, 2005, 04:36 PM
XXL XXL is offline
Authorized User
 
Join Date: Dec 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is the code for the form and the image button:
<input type="image" value="search" src="img/go.gif" width="48" height="25" border="0" name="search" align="absbottom">
<input type="hidden" name="Process" value="True"></form>
<% If Request.Form("Process")="True" Then
'First check for a selection
If Request.Form("cSelect")="" Then
Response.Redirect "pag.asp"
End If
'Proceed with delete
Dim sDelete, cDelete
sDelete = Replace(Request.Form, "&cSelect=", ",")
sDelete = Replace(sDelete, "cSelect=", "")
sDelete = Left(sDelete, Len(sDelete)-13)
set cDelete = Server.CreateObject("ADODB.Command")
cDelete.ActiveConnection = Connection
cDelete.CommandText = "DELETE FROM tblfilme WHERE tblfilme.Nr IN (" & sDelete & ")"
cDelete.CommandType = 1
cDelete.CommandTimeout = 0
cDelete.Prepared = true
cDelete.Execute()
Response.Redirect("pag.asp")
End If%>

When I use the image button I get an error:
Microsoft JET Database Engine- Error '80040e10'
No value given for one or more required parameters.
Pls help!

 
Old January 5th, 2005, 08:15 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

XXL

There looks to be no problem with your button tag

BTW: If you can in future give us the line number from the error including which pysical line it is.

I would say its a problem with your sql statement. Comment out the following lines of code and add a line Eg:

'cDelete.Execute()
'Response.Redirect("pag.asp")
 Response.Write cDelete.CommandText & "<br>"

Run the page and you should see the sql printed to the browser, if you dont see a commer delimited string enclosed in the () that your problem.

BTW: What program created the &cSelect= syntax? I reckon you have cSelect in your statement - this should not appear in your sql anywhere.

Wind is your friend
Matt
 
Old January 5th, 2005, 10:55 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Common causes of 80040e10 errors are listd here ::
http://www.adopenstatic.com/faq/80040e10.asp --- check this out ... you might get some clue!


Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old January 6th, 2005, 07:56 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hi,
try this code
<input type="image" value="search" src="img/go.gif" width="48" height="25" border="0" onclick="submitForm();" style="cursor:hand" name="search" align="absbottom">

surendran
(Anything is Possible)
 
Old January 6th, 2005, 09:49 AM
XXL XXL is offline
Authorized User
 
Join Date: Dec 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've read somewhere on the internet that the image buttons are passing some x and y values.
I did what mat41 said and the sql statement looks like this:
Delete From tblfilme Where tblfilme.Nr In (10&Process=True&search.x=2)

Error
Microsoft JET Database Engine- Error '80040e10'
No value given for one or more required parameters.
/project/pag.asp, line 101

The multiple delete with checkboxes code I found it on this webpage (tutorial):
www.webthang.co.uk/tuts/tuts_dmx/rob3/rob3.asp

It does not work as surendran suggested.






 
Old January 6th, 2005, 06:31 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

XXL

What is wrong with your submit button???? I cannnot see anyting wrong with it, it has nothing to do with your error in any way shape or form. Do you need any assistance with the button?

;;;I've read somewhere on the internet that the image buttons are passing some x and y values.

They can be absolute positioned given x and y coords, I dont believe any of these values are passed with normal table cell placement.

Your statement:
;;;Delete From tblfilme Where tblfilme.Nr In (10&Process=True&search.x=2)
is incorrect, this is what your error is all about. This is exlplained clearly on the page Vadivel gave you a link to. What data type is the field 'Nr' in the table 'tblfilme'? An integer I suspect, it should be:
Delete From tblfilme Where tblfilme.Nr In (12,13,14,15...)


Wind is your friend
Matt
 
Old January 6th, 2005, 07:10 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

XXL

ok I just had a look at the link where you found the code, we can shorten and simplify it.

BTW: had anybody thought this line of code looked weird:
sDelete = Replace(Request.Form, "&cSelect=", ",")

Anyhow:
1..Name all of your checkboxes 'chqName' (yes, name them all the same). It doesnt matter how many there are (put them all in a loop) now when submit is clicked a commer delimited string will be posted to the destination page (all the ids of the checked boxes for delete).
3..Replace your matching lines with the following. Note the comments, you do not need those lines:
'Proceed with delete
Dim sDelete, cDelete
'sDelete = Replace(Request.Form, "&cSelect=", ",")
'sDelete = Replace(sDelete, "cSelect=", "")
'sDelete = Left(sDelete, Len(sDelete)-13)
set cDelete = Server.CreateObject("ADODB.Command")
cDelete.ActiveConnection = Connection
cDelete.CommandText = "DELETE FROM tblfilme WHERE Nr IN (" & request.form("chqName") & ");"

BTW: In your first post you said:
;;;I tried to change the standard submit button with an image button but now the code doesn't work anymore
Are you saying this code worked with a different type of button???


Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide button image aware Javascript How-To 2 September 26th, 2006 05:34 PM
Make a image button as default submit button toshi ASP.NET 1.0 and 1.1 Basics 1 June 1st, 2006 05:25 AM
image as button hosefo81 HTML Code Clinic 2 February 11th, 2004 03:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.