HELP!!! with UPDATE error

Results 1 to 2 of 2

Thread: HELP!!! with UPDATE error

  1. #1
    Join Date
    Dec 1969

    Default HELP!!! with UPDATE error

    I have a login page on my site. Each time someone logs on, a field in my Access database (named "LastVisit") gets updated with the current date. I have a new field named "visits" which I want to use as a counter for the number of times the user has logged on. Here is the code I&#039;m trying to use:<BR><BR>stmt = "UPDATE members SET visits=" & visits & ",LastVisit=#" & Date() & "# WHERE myuser=&#039;" & myuser & "&#039; "<BR><BR>If mypass = cursor("UserPassword") Then<BR> Session("Login") = myuser <BR> visits = cursor("visits")<BR> visits = visits + 1<BR>set cursor = con.Execute(stmt)<BR><BR>But I get the following error when I try to run this:<BR><BR>Microsoft JET Database Engine error &#039;80040e14&#039; <BR><BR>Syntax error in UPDATE statement. <BR><BR>The "visits" field I&#039;ve added to the database is a "Number" data type.<BR><BR>Any ideas on why this won&#039;t work? I have other ASP pages on my site which update numeric data fields, and I don&#039;t have this problem.<BR><BR>Thanks!

  2. #2
    Reggie Guest

    Default RE: HELP!!! with UPDATE error

    Is LastVisit a date/time data type? Response.write your SQL statement to make sure you are getting all the variables passed in correctly with the values you want.

Posting Permissions

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