Monday 25 June 2012

Ex6: VBA - BNOT Operator in ADO

Illustrate BNOT (binary NOT) operator (ADO only.) in VBA

Function TestBnot()
    'Purpose:   Illustrate BNOT (binary NOT) operator (ADO only.)
    Dim cn As ADODB.Connection
    Dim strSql As String
    Dim lngKt As Long
    
    Set cn = CurrentProject.Connection
    strSql = "UPDATE MyTable SET MyIntFlip = BNOT MyInt WHERE MyIntFlip Is Not Null;"
    
    cn.Execute strSql, lngKt
    
    Set cn = Nothing
    TestBnot = lngKt
End Function

No comments:

Post a Comment