Updating a database

Results 1 to 2 of 2

Thread: Updating a database

  1. #1
    Tim Warke Guest

    Default Updating a database

    Please bear with me, I am an ASP newbie.<BR>I am trying to update a record in a database called CHECKIN<BR>IN my asp code i have defined:<BR>username = session("user") ----coming from previous page<BR><BR>Database has NAME of team members and I am trying to get the database to update the TIME and DATE fields for the NAME which corresponds to USERNAME<BR><BR>Here is my (pathetic) attempt at the SQL thingie:<BR><BR>sqlstr = "UPDATE checkin SET time = Time, Date = day(Date) & monthname(month(date)) & year(date) WHERE name = username"<BR>Set rscheckin = checkin.Execute(sqlstr)<BR><BR><BR>Understandably it doesn&#039t work. :(<BR><BR>What would I need to do to update the time and date fields with current time and date for the row corresponding to username.<BR><BR>Thanks<BR><BR>Tim

  2. #2
    Join Date
    Dec 1969

    Default RE: Updating a database

    suppose checkin is table name, then the only error that is obvious is<BR>" ... where name = &#039" & username & "&#039"<BR>1) username is var<BR>2) name is string , you need &#039 &#039 to surround strings in db queries

Posting Permissions

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