This topic is locked

Problems with getting out data out a table

3/27/2012 11:03:45 AM
ASPRunnerPro General questions
M
Maurits author

Hi everyone...
I have a problem with getting data out a table, i might have some done wrong, but i don't see it. Just get a simple HTTP 500 Internal Server Error
The same code works perfect in "Before Record Added" function, but not in the "Before Record Update" function.

Only thing i have changed is BeforeAdd = True/False to BeforeEdit = True/False

Also need to compare the OldValue and Value if not the same re-calculate all the dates again, this i have added to the list
I don't see what i have done wrong!
Thanks for any help!

strSQL = "select * from Seeds where SeedID=" & values("SeedID")

Set rsTmp = server.CreateObject("ADODB.Recordset")

rsTmp.open strSQL, dbConnection
If not rsTmp.EOF then

IF CDate(oldvalues("SowingDate")) <> CDate(values("SowingDate")) then
SD = values("SowingDate")

PD = rsTmp("GerminationDays")

POD = rsTmp("PlantOutMonths")

HD = rsTmp("HarvestMonths")
' more values to add for calculation
values("SowingDate") = SD

values("PottingDate") = CDate(DateAdd("d", PD, SD))

values("PlantingOutDate") = CDate(DateAdd("m", POD, SD))

values("HarvestDate") = Cdate(DateAdd("m", HD, SD))



BeforEdit = True
Else
BeforeEdit = False

Response.Write "<script>alert('ERROR: Master table record not found')</script>"
End If

End If
rsTmp.Close : SET rsTmp = Nothing
Sergey Kornilov admin 3/27/2012

I would suggest to configure IIS to send detailed error message to the web browser. Check this article for more info:

http://learn.iis.net/page.aspx/564/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-default/