problem with addnew?

Results 1 to 2 of 2

Thread: problem with addnew?

  1. #1
    Felicity Guest

    Default problem with addnew?

    I have a form that has 2 fields. fdate and ftime. fdate is a short date format in the Access 2000 database and ftime is a time format. The user enters a date like 8/24/01 and selects a time from a drop down like 10:30 AM. The form submits to a page that does this:<BR><BR>fdate = request("fdate")<BR>ftime = request("ftime")<BR><BR>SQL = "SELECT * FROM test WHERE fdate = #" fdate& "# AND ftime = #" &ftime& "#"<BR>set oRs = conn.Execute(SQL)<BR>If oRs.EOF Then<BR>Response.Redirect "newdate.asp?fdate=" & "&ftime=" & Server.URLEncode(ftime) <BR>Else<BR>id=oRs("id")<BR>Response.Redirect "existdate.asp?id="&id<BR>End If <BR><BR>If the date does not exist it goes to newdate.asp with the variables and if it does exist it gets the ID and goes to existdate.asp.<BR><BR>If the date is new it does this on newdate.asp<BR><BR>RS.AddNew<BR>RS("fdate") = request("fdate")<BR>RS("ftime") = request("ftime")<BR>end if<BR>RS.update<BR>ID = RS("ID")<BR><BR>Here is the problem. If I use the code to enter a new date it goes into the db just fine. The response.write looks fine and so on. Now if I go back and try to enter that same exact date and time it still goes to newdate.asp. The records look fine in the database. However, if I enter the date and time directly into the database by hand it shows it as an existing date. Again, no difference in the 2 records, manual and code entered. If I try the date and time I manually entered I get existdate.asp but from the one the code entered I get newdate.asp. What is going on here???? Anyone???<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: problem with addnew?

    How about this,<BR><BR>RS.AddNew<BR>RS("fdate") = "#" & request("fdate") & "#"<BR>RS("ftime") = "#" & request("ftime") & "#"

Posting Permissions

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