PDA

View Full Version : Unbelieveable!


ShMiL
02-28-2003, 03:16 PM
I've done this hundreds of times and never got stuck with it!
I want to change the value of the yes/no field in the DB(access) - default is NO.
I tried these in my SQL statement ("is_active"=name of field):
is_active=True
is_active=true
is_active='True'
is_active='true'
is_active=1
is_active=0
is_active='yes'
is_active='Yes'

Nothing changed it!!!!!!!!!

I tried to display this field, an it printed: False.
I don't know what to do with it! Anyone?

PS
the problem is with checkbox, but in order to find out the format, I first tried to manually, without any form, to change the value of is_active.

Thanks!

raven
02-28-2003, 03:22 PM
It's while since I've used Access, but I have a feeling that you need to set the value to -1 .

ShMiL
02-28-2003, 03:40 PM
I tried it now.
NADA.

it's very weird...

Roy Sinclair
02-28-2003, 03:56 PM
I strongly suspect you're looking at the wrong bit of code. How is the value being written back to the DB?

ShMiL
02-28-2003, 04:17 PM
with SQL UPDATE statement. (conn.execute that is)
Everything else updates perfectly...

oracleguy
02-28-2003, 05:25 PM
You have to set it to 1 if you want it be selected and 0 if you want it de-selected.

I believe thats how it works... haven't used Access in a while.

ShMiL
02-28-2003, 05:39 PM
that's what I usually use.
But it doesn't work here for some reason.

arnyinc
02-28-2003, 07:28 PM
update table1 set mycheckbox='1'

ShMiL
02-28-2003, 08:04 PM
I just double checked it again.
The problem was the form at the page which referred to the execution page.
I changed the form method from "post" to "get" to look at the Address Bar and forgot about it...
Anyways, the execution was inside an "if" condition which asked about a paramter like this:
request.form ("")

Since it was executed in the "get" method, the condition returned false and the execution was never executed.

Now everything's working great!
Thanks for your help...

whammy
03-01-2003, 02:08 AM
Heh... that'll do it! Can't say I've never used "get" on accident myself, although if I'm going to debug post variables, I'll usually just loop through the Request.Form() collection and print them to the page. ;)

Since the problem is solved, I'll go ahead and close the thread. Glad you figured it out.