Option Explicit
Const DSN = "Driver={MySQL ODBC 3.51 Driver};Uid=root;Pwd=;Server=localhost;Database=test;OPTION=1 + 2 + 8 + 16384"

Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
Const adOpenUnspecified = -1

Const adUseNone = 1
Const adUseServer = 2
Const adUseClient = 3

Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3

'---- ParameterDirectionEnum Values ----
Const adParamUnknown = &H0000
Const adParamInput = &H0001
Const adParamOutput = &H0002
Const adParamInputOutput = &H0003
Const adParamReturnValue = &H0004

'---- CommandTypeEnum Values ----
Const adCmdUnknown = &H0008
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004
Const adCmdFile = &H0100
Const adCmdTableDirect = &H0200

Const adInteger=3
Const adDate=7
Const adVarChar=200

Dim cnxDatabase
Dim strSQL

' connecting database
Set cnxDatabase = CreateObject("ADODB.Connection")
cnxDatabase.Open(DSN)
'WScript.Echo "Connected"
cnxDatabase.Execute("USE test")

' querying data
strSQL = "SELECT Rbr, Godina, Tip1, Datum1, Datum3, Konto, Dug, Pot, Status, Opis, Marker" &_
  " FROM bug28016" &_
  " WHERE Godina = 2006" &_
  " AND Tip1 = 'IRA'" &_
  " ORDER BY Rbr"

Dim rs
Set rs = CreateObject("ADODB.Recordset")
With rs
    .ActiveConnection = cnxDatabase
    .CursorLocation = adUseClient
    .LockType = adLockOptimistic
    .CursorType = adOpenDynamic
    .Properties("Update Criteria").Value = 0
    .Open(strSQL)
    'WScript.Echo "RS Opened"
End With

rs.MoveFirst
'WScript.Echo "Moved first"

Do While Not rs.EOF
    if IsNULL(rs(4)) Then 
        rs.Fields("Marker") = "Z1"
        rs.update
    end if
    rs.MoveNext
Loop

WScript.Echo "Done looping"
rs.close
cnxDatabase.Close
Set rs = nothing
Set cnxDatabase = nothing
