SQLScholar
Programmer
Hi all,
The below code seems to have stopped working when i have put it into SSIS and took it back out again. Not sure what i have done!
I am getting cannot use parentheses when calling a sub. on line 8 (recordset open). I am sure this was working before!
Any ideas?
Daniel
----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss
Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
The below code seems to have stopped working when i have put it into SSIS and took it back out again. Not sure what i have done!
Code:
StrConnect = "Driver={SQL Server};Server=(local);Database=audit;UID=sa;PWD=password"
cnt = CreateObject("ADODB.Connection")
cnt.Open(StrConnect)
recordSet = CreateObject("ADODB.Recordset")
SQLStr = "Select * from aduseroutput where lastlogontimestamp <> 0 and objectclass = 'user'"
recordSet.Open(SQLStr, cnt, 1, 1)
recordset.MoveFirst()
x = 0
Do Until recordset.EOF
objUser = GetObject("LDAP://" & recordset.fields(0).Value)
objLastLogon = objUser.Get("lastLogonTimestamp")
objLastLogon = objLastLogon.HighPart * (2 ^ 32) + objLastLogon.LowPart
objLastLogon = objLastLogon / (60 * 10000000)
objLastLogon = objLastLogon / 1440
objLastLogon = objLastLogon + #1/1/1601#
cnt.Execute("Update aduseroutput set Convlastlogontimestamp = '" & cstr(objLastLogon) & "' where DN = '" & Recordset.fields(0).Value & "'")
objUser = Nothing
objLastLogon = Nothing
Recordset.MoveNext()
Loop
recordset.Close()
cnt.Close()
recordset = Nothing
cnt = Nothing
I am getting cannot use parentheses when calling a sub. on line 8 (recordset open). I am sure this was working before!
Any ideas?
Daniel
----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss
Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------