Re: Update Database (mdb) script



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
|


.



Relevant Pages

  • Re: How can I display data from SQL
    ... Dim cnn As ADODB.Connection ... Dim STRSQL As String ... Set cnn = New ADODB.Connection ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Mail Merge from Access
    ... I have a suspicion that what happens otherwise is that ADO DB creates a recordset that has locking implications and is not necessarily cleaned up by the cnn.Close or perhaps Set cnn = Nothing. ... Dim strSQL As String ... Dim objWord As Word.Document ...
    (microsoft.public.word.mailmerge.fields)
  • Run timer Error
    ... Public Function test1() ... Dim cnn As ADODB.Connection, rs As New ADODB.Recordset, strSQL As String ... Run time error: '-214217873 ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Upgrading Pervasive 2000i to V9
    ... The applications that use the Btrieve API work ... > Dim cnn As ADODB.Connection ... > Dim rst As ADODB.Recordset ... > Set cnn = New ADODB.Connection ...
    (comp.databases.btrieve)
  • Re: ALTER COLUMN Help
    ... use the controls AfterUpdate event to change that controls Default value. ... Dim strSQL, strDef As String ... Set cnn = CurrentProject.Connection ...
    (microsoft.public.access.forms)