Update field calculates date - TechRepublic
General discussion
September 10, 2000 at 12:17 PM
jlindseth

Update field calculates date

by jlindseth . Updated 25 years, 6 months ago

I need a little help. I have an MS Access database that users are going to be inputting data via a website, then once the data is in the database they will periodically go into the database via a website and update the various fields. It is currently working great except for one field, the ?startdate? field. It calculates the date and writes the product or sum to the database instead of the actual date (example?. if 1-27-73 is put in the update field, it writes ?99 to the database. Thanks forthe help!!!! Here is a scaled down version of the code from the ASP:

<% strCasename = Request.Form("Casename") strReferralDate = Request.Form("ReferralDate") sngStartdate = Request.Form("Startdate") If Request.Form("Action") = "Delete Record"Then strAction = "D" Else strAction = "U" End If If strAction = "U" Then SQL = "UPDATE CFSInput SET CFSInput.ReferralDate = '" & strReferralDate & "', CFSInput.Startdate = '" & sngStartdate & "', " WHERE CFSInput.casename = '" & strcasename & "'" Else SQL = "DELETE CFSInput.* From CFSInput WHERE CFSInput.casename = '" & strcasename & "'" End If Set objConnection = Server.CreateObject("ADODB.Connection") objConnection.Open "FGCDATA" Set objCommand = Server.CreateObject("ADODB.Command") Set RS = Server.CreateObject("ADODB.Recordset") objCommand.CommandText = SQL objCommand.CommandType = adCmdText Set objCommand.ActiveConnection = objConnection RS.Open objCommand,,adOpenForwardOnly,adLockReadOnly If strAction = "U" Then %>

Record <%= strcasename %> Updated

<% Else %>

Record <%= strcasename %> Deleted

<% End If %>

This discussion is locked

All Comments