Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update date value to Access database.

Status
Not open for further replies.
Jan 21, 2005
46
US
Hi. I have update.asp(form) and update_records.asp(update code) that work fine to update already existing date value. But when I tried to enter a date value(ETD) to an empty field, an error occurs in the next box entry:
Provider error '80020005'

Type mismatch.

/db/update_records.asp, line 89

Line 89 is: rsUpdateEntry.Fields("ETA") = Request.Form("ETA")

In the update.asp form the code looks like:<input type="text" name="ETA" size="13" value="<% = rsGuestbook("ETA") %>">

I actually found the reason that I need to deal with empty date values. How can I do that?
 
Maybe you can do something like this:
[tt]
if IsDate(Request.Form("ETA")) then
rsUpdateEntry.Fields("ETA") = Request.Form("ETA")
else
rsUpdateEntry.Fields("ETA") = Null 'maybe just skip this row?
end if
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top