Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
ASPProtect Version 8.x Support
 CJWSoft Support Info : ASPProtect Version 8.x Support
Subject Info: Error on custom Checkbox.. A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
alanelli
New User
New User
Avatar

Joined: July/03/2008
Online Status: Offline
Info: 9
Added: July/09/2008 at 10:13am | IP Logged Quote alanelli

Hi Chris,

This is my first post so i wish myself good luck. ;-)

-----

I added a customized Checkbox(es) on each of the Users table and Groups table.

For instance the new field is "Group_Public_View" in groups table.

I added the following code into the "edit_group.asp" page:

<input type="checkbox" name="Group_Public_View" value="True" <% If CmdEditGroup("Group_Public_View") then %><% Response.Write (" checked")%><% End If %>>

I did the similar for the Users table as below:

<input type="checkbox" name="Group_Leader" value="True" <% If Group_Leader then %><% Response.Write (" checked")%><% End If %>>

The problem is; when I save these pages, it saves the info fine as long as I check these boxes (True), but if I uncheck a box (on edit_group.asp for instance) I get the following error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

/account/admin/save_group.asp, line 445

and the following on "edit.asp"

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

/account/admin/save.asp, line 420

------

So, please tell me how I can get around these errors and make these checkboxes work seamlessly.

Btw, I am not an ASP programmer, as you can image. I wish i was.

Thanks a million for your help.

Cheers,
A. ;-)

Back to Top View alanelli's Profile Search for other info by alanelli
 
alanelli
New User
New User
Avatar

Joined: July/03/2008
Online Status: Offline
Info: 9
Added: July/09/2008 at 10:22am | IP Logged Quote alanelli

Dear Chris,

Please disregard my post regarding the custom checkbox.

To my much surprise, I just figured it out. A miracle from my end.

I guess I had to post this messgae in order for my brain start working or something like that.

But thnak you anyway. Hope this didn't take any of your time already.

Cheers.

Back to Top View alanelli's Profile Search for other info by alanelli
 
chrisw184
New User
New User


Joined: January/09/2009
Online Status: Offline
Info: 3
Added: January/09/2009 at 4:43am | IP Logged Quote chrisw184

Hi alanelli

I've just been searching around for an answer to my problem and my search led me to your post about the checkboxes.

To my surprise your query is exactly the same as mine. However, luckily for you, you worked it out...unfortunately for me I can't.

My code is very simliar to yours and I need to be able to update the database when I untick a checkbox and get the same error. It works fine, as you stated, when I tick a box and it updates.

I would be most grateful if you could enlighten me as to how you solved the issue. Or for that matter anyone reading this post could help then I would be grateful.

Thanks
Back to Top View chrisw184's Profile Search for other info by chrisw184
 
alanelli
New User
New User
Avatar

Joined: July/03/2008
Online Status: Offline
Info: 9
Added: January/09/2009 at 9:29am | IP Logged Quote alanelli

Hi Chris,

It's actually very easy.... Open up the page that saves the info you're updating.... such as "save.asp" and find the line that generates that error.

It must be something like this:

   CmdEditUser.Fields("Your New Field's Name") = NULL

And the just replace "NULL" with the word "False" (minus the quotes of course).

And it should take care of that annoying problem.

Hope this helps.

Again, I'm not a ASP programmer but i've learned a lot frm this particluar application so if you need any further help, i'll do my best to send you some sugeestions, advice etc.

Good luck.

Anthony ;-)

 

Back to Top View alanelli's Profile Search for other info by alanelli
 
chrisw184
New User
New User


Joined: January/09/2009
Online Status: Offline
Info: 3
Added: January/09/2009 at 9:50am | IP Logged Quote chrisw184

Hi Anthony

Thanks for the quick reply!

There must be something magical about this page as not long after posting my last post to you, and many hours previously trying different ways, I managed to figure it out!

I'm no ASP programmer also and this project has taught me a lot.

My result was different to yours so I'll share with you and we both learn something new from each other.

My update form ahs the following:

<input <% If rsReport("accident") = True Then Response.Write("checked=""checked""")%> name="accident" type="checkbox" id="accident" value=1>

An my page that does the actual database update has:

If Request.Form("accident") = 1 then
rsUpdateEntry.Fields("accident") = Request.Form("accident")
else
rsUpdateEntry.Fields("accident") = 0
End if

This is the code that now works.

Thanks anyway for your help and again for your quick reply.

Chris
Back to Top View chrisw184's Profile Search for other info by chrisw184
 
alanelli
New User
New User
Avatar

Joined: July/03/2008
Online Status: Offline
Info: 9
Added: January/09/2009 at 10:00am | IP Logged Quote alanelli

Hey Chris,

I'm glad you have solved your problem. I know it feels great when you finally do that. ;-)

I'm just curious. What page is this that you had the problem in. Part of ASP Protect version 8.0 or no?

Good luck on the rest of your project.

Anthony ;-)

Back to Top View alanelli's Profile Search for other info by alanelli
 
chrisw184
New User
New User


Joined: January/09/2009
Online Status: Offline
Info: 3
Added: January/09/2009 at 10:07am | IP Logged Quote chrisw184

Hi Anthony

The whole thing is hand coded from scratch from via online tutorials and lessons and lots of adaptation and trial and error to fit my requirements.

This post and forum just happened to come up in my search for errors.

That was the last piece of my puzzle for the project which I can happily say I'm pleased with as all works how I want and how the client wants.

Thanks and regards

Chris
Back to Top View chrisw184's Profile Search for other info by chrisw184
 
cwilliams
Admin Group
Admin Group
Avatar
CJWSoft Web Software Developer

Joined: April/06/2004
Online Status: Offline
Info: 1769
Added: January/09/2009 at 10:16am | IP Logged Quote cwilliams

ya, your dealing with a boolean (yes/no) field so you have to give it a 1/0 or a true/false value... else an error

__________________

Best Regards, Christopher Williams www.CJWSoft.com
Back to Top View cwilliams's Profile Search for other info by cwilliams Visit cwilliams's Homepage
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area


Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.powerasp.com,www.aspclassifieds.com,www.aspphotogallery.com,www.codewanker.com