How do you update all of the records in an Access (.mdb) table where the
checkboxes are not checked?
--
Cadstillo

Re: Update Database (mdb) script by Bob

Bob
Mon Jul 10 13:56:18 CDT 2006

Cadstillo wrote:
> How do you update all of the records in an Access (.mdb) table where
> the checkboxes are not checked?

Are you talking about an ASP page? If so, .inetserver.asp.db would have
been a better newsgroup to post to.

The short answer, the same way you do it for checkboxes that are
checked: execute an UPDATE sql statement for each checkbox.

The slightly longer answer: unchecked checkboxes will not show up in the
Request collection, so you will need to check for the absence of the
checkbox in Request to determine whether or not it is checked.

The long answer will require more details from you: are you processing
multiple records, or a single record? Post your details to the asp.db
group.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Re: Update Database (mdb) script by Cadstillo

Cadstillo
Mon Jul 10 14:25:02 CDT 2006

This isnt an ASP, just a stand-alone access database.

How do you do the Update Sql statement?

--
Cadstillo



"Bob Barrows [MVP]" wrote:

> Cadstillo wrote:
> > How do you update all of the records in an Access (.mdb) table where
> > the checkboxes are not checked?
>
> Are you talking about an ASP page? If so, .inetserver.asp.db would have
> been a better newsgroup to post to.
>
> The short answer, the same way you do it for checkboxes that are
> checked: execute an UPDATE sql statement for each checkbox.
>
> The slightly longer answer: unchecked checkboxes will not show up in the
> Request collection, so you will need to check for the absence of the
> checkbox in Request to determine whether or not it is checked.
>
> The long answer will require more details from you: are you processing
> multiple records, or a single record? Post your details to the asp.db
> group.
>
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>

Re: Update Database (mdb) script by Bob

Bob
Mon Jul 10 14:54:57 CDT 2006

So this is an Access application? With an Access form? If so, you are
really in the wrong place. vbscript is not used in Access: VBA is. Try
microsoft.public.access.forms.

Again, they will need more details.

Cadstillo wrote:
> This isnt an ASP, just a stand-alone access database.
>
> How do you do the Update Sql statement?
>
> --
> Cadstillo
>
>
>
> "Bob Barrows [MVP]" wrote:
>
>> Cadstillo wrote:
>>> How do you update all of the records in an Access (.mdb) table where
>>> the checkboxes are not checked?
>>
>> Are you talking about an ASP page? If so, .inetserver.asp.db would
>> have been a better newsgroup to post to.
>>
>> The short answer, the same way you do it for checkboxes that are
>> checked: execute an UPDATE sql statement for each checkbox.
>>
>> The slightly longer answer: unchecked checkboxes will not show up in
>> the Request collection, so you will need to check for the absence of
>> the checkbox in Request to determine whether or not it is checked.
>>
>> The long answer will require more details from you: are you
>> processing multiple records, or a single record? Post your details
>> to the asp.db group.
>>
>>
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Re: Update Database (mdb) script by Dave

Dave
Mon Jul 10 16:02:58 CDT 2006

Dim cnn, dbPath, strSQL
dbPath = "c:\data\access\test.mdb"
Set cnn = CreateObject("ADODB.Connection")
Set Rs1 = CreateObject("ADODB.Recordset")
cnn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath
strSQL = "UPDATE Table1 SET Field1 = 'aaa', Field2 = 123, Field3 = 456 " _
& "WHERE (((ChkBox)=0)); "

cnn.Execute strSQL

cnn.close

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Cadstillo" wrote:
| How do you update all of the records in an Access (.mdb) table where the
| checkboxes are not checked?
| --
| Cadstillo
|



Re: Update Database (mdb) script by Cadstillo

Cadstillo
Mon Jul 10 16:09:02 CDT 2006

Thanks I will try it out!!
--
Cadstillo



"Dave Patrick" wrote:

> Dim cnn, dbPath, strSQL
> dbPath = "c:\data\access\test.mdb"
> Set cnn = CreateObject("ADODB.Connection")
> Set Rs1 = CreateObject("ADODB.Recordset")
> cnn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath
> strSQL = "UPDATE Table1 SET Field1 = 'aaa', Field2 = 123, Field3 = 456 " _
> & "WHERE (((ChkBox)=0)); "
>
> cnn.Execute strSQL
>
> cnn.close
>
> --
>
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "Cadstillo" wrote:
> | How do you update all of the records in an Access (.mdb) table where the
> | checkboxes are not checked?
> | --
> | Cadstillo
> |
>
>
>

Re: Update Database (mdb) script by Cadstillo

Cadstillo
Mon Jul 10 16:17:02 CDT 2006

That worked!!

Thanks

--
Cadstillo



"Dave Patrick" wrote:

> Dim cnn, dbPath, strSQL
> dbPath = "c:\data\access\test.mdb"
> Set cnn = CreateObject("ADODB.Connection")
> Set Rs1 = CreateObject("ADODB.Recordset")
> cnn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath
> strSQL = "UPDATE Table1 SET Field1 = 'aaa', Field2 = 123, Field3 = 456 " _
> & "WHERE (((ChkBox)=0)); "
>
> cnn.Execute strSQL
>
> cnn.close
>
> --
>
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "Cadstillo" wrote:
> | How do you update all of the records in an Access (.mdb) table where the
> | checkboxes are not checked?
> | --
> | Cadstillo
> |
>
>
>

Re: Update Database (mdb) script by Dave

Dave
Mon Jul 10 16:38:26 CDT 2006

You're welcome.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Cadstillo" wrote:
| That worked!!
|
| Thanks
|
| --
| Cadstillo



Re: Update Database (mdb) script by Bob

Bob
Tue Jul 11 08:12:14 CDT 2006

Dave Patrick wrote:
> You're welcome.
>
Well done Dave! It never occurred to me that he was talking about
boolean (Yes/No) fields rather than checkboxes on a form!
What brand of crystal ball are you using? I need to look into getting
one of those ... ;-)
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Re: Update Database (mdb) script by Dave

Dave
Tue Jul 11 21:27:42 CDT 2006

LOL. Well, it just seemed that had to be the underlying data type.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Bob Barrows [MVP]" wrote:
| Well done Dave! It never occurred to me that he was talking about
| boolean (Yes/No) fields rather than checkboxes on a form!
| What brand of crystal ball are you using? I need to look into getting
| one of those ... ;-)
| --
| Microsoft MVP -- ASP/ASP.NET
| Please reply to the newsgroup. The email account listed in my From
| header is my spam trap, so I don't check it very often. You will get a
| quicker response by posting to the newsgroup.
|
|