- ASP - Database Table Display
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·What's New?
Mail List


Date/Time Stamping User Input
Do you have users entering data into an Access db online?  Would you like to know when they entered their input?  Utilizing the default value option in Access you can create a Date/Time field that will automatically enter the date date() or date time now() when you insert values into the table.  The following example will take user inputted text add it to an Access db that has three fields sample_text (whatever the user enters), input_date (set to date(),)and input_datetime (set to now()).  After the input is added to the dc the last ten additions will display.
View the Output
Text View
Print View
Mail this Link
Download the Code
View the Data

<title> Stamping User Input)</title>
<body bgcolor="#FFFFFF">

'Check to see if the user has inputted anything
if u_text <> "" then

'Insert the users inputted value only into the Access db
cn="driver={Microsoft Access Driver (*.mdb)};"
cn=cn & "dbq=" & server.mappath(accessdb)
set rs = server.createobject("ADODB.Recordset")
sql = "insert into datetime_table (sample_text) "
sql = sql & "values ('" & u_text & "')"
rs.Open sql, cn

'Read the Access db for the last 10 in descending order
sql="select * from datetime_table order by input_datetime desc"
rs.Open sql, cn
'Write out the last 10 inputted values to the browser
for count = 1 to 10

<b>Number <%= count %> Most Recent</b> <br> 
<b>Inputted Text:</b> <%= rs("sample_text") %> <br>
<b>Date Inputted:</b> <%= rs("input_date") %> <br>
<b>Date/Time Inputted:</b> <%= rs("input_datetime") %> <br>
<b>Day/Date Inputted:</b> <%= formatdatetime(rs("input_datetime"),vblongdate) %> <br>


'If there is no user inuput or if a blank was entered
'display the input form

<form action="<%= request.servervariables("script_name") %>" method="post">
<input type="text" name="u_text" maxlength="25">
<input type="submit" value="Submit">
<% end if 'end check for user input %>




ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement is hosted by
    Donate Food Online with a Mouse Click at
    Donate Land Online with a Mouse Click at
    © 1999 - 2018
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3