Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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
  #1 (permalink)  
Old April 27th, 2005, 10:14 AM
Registered User
Join Date: Apr 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default updating yes/no field in MS Access database


My problem is about 3 checkboxes that I want to link to 3 yes/no fields in my database.
 I want to update some information and when I check/uncheck the checkbox in my ASP page I want to check/uncheck the yes/no fields.
This is the code that I am using:
IF Request.Form ("chksNeeds?.checked") = true THEN
    if RS.Fields ("sNeeds?") = false then
        RS ("sNeeds?") = true
    end if
    if RS.Fields ("sNeeds?") = true then
        RS ("sNeeds?") = false
    end if
It only works only once and only if the field in the database is set to TRUE. I know that unchecked checkboxes are not passed to the server...(I did a little research), but still don't have any clue on how to fix this problem!

  Does anybody have any ideea on how to get this thing working?


  #2 (permalink)  
Old April 29th, 2005, 06:36 AM
Authorized User
Join Date: Jul 2004
Location: Hyderabad, Andhra Pradesh, India.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to raj_makro

  Try the following
 IF Request.Form ("chksNeeds?") = "on" THEN
inplace of
 IF Request.Form ("chksNeeds?.checked") = true THEN


  #3 (permalink)  
Old May 6th, 2005, 11:04 AM
Registered User
Join Date: May 2005
Location: , Kansas, .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

Possibly you could use form fields or drop down menus that when selected = a number. That way in your db it will always have a "yes" or "no" value based on the number assigned...
EG: Yes="-1"
No = 1

Then write a bit that says If the fiels is -1 then check yes, if field is 1 then check no.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Updating MS Access database javlet Java Databases 1 April 24th, 2007 07:16 AM
Database migration MS Access 2003 to MS SQL 2000 ayazhoda SQL Server 2000 3 April 23rd, 2007 11:38 AM
MS ACCESS UPDATING A SUBFORM FIELD bernieregans SQL Language 1 February 3rd, 2006 04:26 PM
MS Access Field Name itHighway Classic ASP Basics 3 February 22nd, 2005 12:25 AM
Accessing AutoNumber field of MS Access Using ASP MuthuAL Classic ASP Databases 1 January 22nd, 2005 11:30 AM

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