minority
07-28-2005, 04:56 AM
Ok i have created a vb script which basically will run every day automatically to remove user id and users name from the database if they have not completed the investigation yet (This may change to if they dont complete it by target date) but it will still run every day or so.
ok here my script set rsinsert = CreateObject ("ADODB.Connection")
Set rsncr = CreateObject("ADODB.Recordset")
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Intranet\ncr\database\ncr.mdb;User Id=admin;Password=;"
strSQL = "SELECT Record_ID, Actionee_ID, Actionee FROM Ticket WHERE Investigated = False AND Closed = False"
rsncr.Open strSQL, strCon
Do While not rsncr.EOF
drec = rsncr("Record_ID")
response.write(id)
strSQL = "UPDATE Ticket set [Actionee] = '', [Actionee_ID] = WHERE (Report_ID = "&drec&") "
rsinsert.open = strCon
rsinsert.execute (strSQL)
rsinsert.Close
rsncr.MoveNext
Loop
rsncr.close
Set rsinsert = Nothing
Set rsncr = nothing
set strCon = nothing
Basically i am trying to query database to find all the report_ID that have not been closed or investgated yet and then set the actionee_ID and actionee to null to allow others to investgate this.
I seem to have a problem getting the values from the database to put into my update i aint even sure i am doing this correctly.
I have full access to the server to allow this to run when i choose.
ok here my script set rsinsert = CreateObject ("ADODB.Connection")
Set rsncr = CreateObject("ADODB.Recordset")
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Intranet\ncr\database\ncr.mdb;User Id=admin;Password=;"
strSQL = "SELECT Record_ID, Actionee_ID, Actionee FROM Ticket WHERE Investigated = False AND Closed = False"
rsncr.Open strSQL, strCon
Do While not rsncr.EOF
drec = rsncr("Record_ID")
response.write(id)
strSQL = "UPDATE Ticket set [Actionee] = '', [Actionee_ID] = WHERE (Report_ID = "&drec&") "
rsinsert.open = strCon
rsinsert.execute (strSQL)
rsinsert.Close
rsncr.MoveNext
Loop
rsncr.close
Set rsinsert = Nothing
Set rsncr = nothing
set strCon = nothing
Basically i am trying to query database to find all the report_ID that have not been closed or investgated yet and then set the actionee_ID and actionee to null to allow others to investgate this.
I seem to have a problem getting the values from the database to put into my update i aint even sure i am doing this correctly.
I have full access to the server to allow this to run when i choose.