ASP Date problem!
I have this code to recoed in an Access table called DeleteLog, when a user deletes a document from another table called Documents. However I cannot get the date to work. I want to knoexactly when the document was deleted. Can anyone help?
Set rs = Server.CreateObject("ADODB.Recordset")
vDID = Request.QueryString("DID")
var_date=date() 'get the current date
GetDeletedDocument Conn, rs, vDID 'returns all info about the deleted doc
SQL = ""
SQL = SQL & "Insert INTO DeleteLog (DeletedFrom, ItemDeleted, User, Date)"
SQL = SQL & " VALUES "
SQL = SQL & "('Documents','" & rs("Doc_Title") & "','" & Session("User") & "','" & var_date & "')"
hmm. The method you have used should return a valid date...
var_date = CDate(Month(Now()) & "-" & Day(Now()) & "-" & Year(Now()))
Just an add-on,
You could simply use the Now() method to store the exact date and time the file was deleted.
Finally, its probably best to use cast date (CDate()) rather than cast string (CStr()) in this case since we are dealing with dates.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)