update date in db

Results 1 to 4 of 4

Thread: update date in db

  1. #1
    Corin Guest

    Default update date in db

    I want to automtically update the date field in my db when ever someone accesses a page. Please help.<BR><BR>Thanks in advance

  2. #2
    Ryan S. Guest

    Default RE: update date in db

    How about this...<BR><BR>assuming you have a ADODB.Connection that is called MyConn<BR><BR>SQL = "update TABLE set DATECOLUMN = " & DATE<BR><BR>MyConn.Execute SQL<BR><BR>DATE is a Function in VB and VBScript which gets the time from the server.

  3. #3
    Corin Guest

    Default thanks but now I get an error

    This:<BR><BR>&#060;%<BR>Dim conn<BR>Set conn = Server.CreateObject("ADODB.Connection")<BR>conn.Op en "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Session("DatabasePath") & ";"<BR><BR>Dim SQL <BR>SQL = "update tblUpdate set myDate = " & DATE & " WHERE Sport = &#039Volleyball&#039"<BR> <BR>Response.write (SQL)<BR><BR>conn.Execute SQL<BR> <BR> <BR>%&#062;<BR><BR>Gets me this:<BR><BR>update tblUpdate set myDate = 1/13/00 WHERE Sport = &#039Volleyball&#039 <BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver]Division by zero (null) <BR><BR>/wcaa/updateDate.asp, line 14 <BR>

  4. #4
    Corin Guest

    Default Thanks I found out the problem

    I forgot to put single quotes inside the SQL Statement<BR><BR>update tblupdate set mydate = &#039" & DATE & "&#039 WHERE ......<BR><BR>Thanks for the help, you got me on the right track

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts