VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    SOLVED - see post # 3

    Hi all. I've been away hammering on a project my boss enlisted me in. Anyway. I have a mdb database i'm working on and in one aspect of it i am utilize a grid to show and set a few values though mainly boolean. They are true/false values in a check box to make flagging the rows easier. But now i need to reset them all to no value (blank box), or false. I added a button to the form. Note, this is not the actual ms access IDE, it is a standalone short program to test something out really quick for him. I'm looking for an SQL version if possible. I can feed that into the backend code elsewhere.

    I think it can be done in an update query but i'm not sure. I usually use ms access for that through the query section and then through { menu\View\SQL View } obtain the SQL text part. I know, cheating, but I can't remember everything in this beast.

    Thank you very much in advance.

    fields and values:

    Code:
    prodID  YesNo  Notes
    ------  -----  -----
    1       true   don't run
    2       true   don't run
    3       false  
    4       true   look both ways
    5       true   its supper man
    6       false  
    7       true   don't run
    8       true   bake me some pizza
    9       true   home made pizza dough
    10      true   mini pizza
    Last edited by vhelp; 9th May 2015 at 17:43.
    Quote Quote  
  2. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    I think I have SQL script working:

    Code:
    UPDATE tbl SET tbl.yesno = False;
    EDIT:
    Well, it almost works. while it complete the resting to all FALSE, I also get an error message:

    'Current provider does not support returning multiple recordsets from a single execution.'

    I'll figure it out.
    Last edited by vhelp; 7th May 2015 at 23:46.
    Quote Quote  
  3. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    SOLVED

    In the windows application I was building (using delphi 7) I was using the wrong windows non-visual components to do the job.

    Also, I enhanced the SQL string to only update any records who's boolean value were check-marked or True, super quick performance.

    Code:
    UPDATE tbl SET tbl.yesno=false WHERE tbl.yesno=true
    Quote Quote  
  4. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    No reason whatsoever why you first code would not do the job - SQL would simply ignore the rows that would not require updating. I doubt that the issue was the SQL but, as you said, the program itself since the new code simply replicates the result of the first.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!