This topic is locked

Error Adding empty records

5/27/2005 2:30:47 PM
ASPRunnerPro General questions
S
Skynet author

I have a table with several records. Some are required another not. I have date field that is not required.
Whe I try to Add record with empty date, appears this error:
Microsoft Cursor Engine error '80040e21'

The operation in several steps generate errors. Check the states values.
/report/FreightCommissionDetail_add.asp, line 605
If I put any date error doesn't appear. When I edit record and remove date value that i use in Add, works normally. Apparently I can't use in date empty values.
What is the error in add page? How can I fix?

S
Skynet author 5/27/2005

Values for Date fields are processed under javascript function called (in add.asp):
SetDate##FIELDNAME#() but only are processed if Date field is changed.
onchange="java script: SetDate##FIELDNAME##()
If I change the value and after remove the value (empty) and click on save, the record is saved.
How can I fix?

S
Skynet author 5/27/2005

I found non practical solution for this problem. To call the funtion is necessary select any month in the list and after select the first option of the list (blank value) in this form the javascript is called "onchange".
Perhaps, will be good if this problem can be fixed.

Sergey Kornilov admin 5/30/2005

Hi,
what database do you use?

What Date Edit format do you use?

S
Skynet author 5/30/2005

Thanks for your answer. See information required bellow.
Database: Microsoft Access 2000 version.

Format date in Database: Medium Date.

Format in asp page: MMM/DD/YYYY.
Skynet

Sergey Kornilov admin 5/31/2005

Hi,
please zip and send to support@xlinesoft.com all files from ASPRunnerPro output folder with subfolders along with project file and your sample database for investigation.

Sergey Kornilov admin 6/6/2005

Hi,
as I see you use custom template to add records to database using UCase function. It breaks add page code.
Modify Template you use for your project.

Replace this code snippet in add.asp page

elseif GetEditFormat("##FIELD##")<>FORMAT_DATABASE_IMAGE and GetEditFormat("##FIELD##")<>FORMAT_DATABASE_FILE then

rs("##FIELD##") = UCase(strValue)

else


with this:

elseif GetEditFormat("##FIELD##")<>FORMAT_DATABASE_IMAGE and GetEditFormat("##FIELD##")<>FORMAT_DATABASE_FILE then

  if strValue<>Null then

      rs("##FIELD##") = UCase(strValue)

  else

      rs("##FIELD##") = strValue

  end if

else

S
Skynet author 6/6/2005

Thanks a lot. I will change now.
Skynet <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=4696&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />