1. Steve Albin
  2. Valentina Database ADK
  3. 木, 9月 30 2021, 02:49 PM
  4.  メールで購読
I've upgraded from V4RB 9.6.4 to the latest version via the Omegabundle. I am using MacOS Big Sur 11.6.

I notice in the release notes that there is a change to support the Xojo DateTime field.

I am finding that if I simply read a Vdatetime field from a cursor, it will display as 1970-01-01 if the field is NULL, but correctly if not NULL.

If I check for NULL on a Vdatetime field that is NULL and has NOT been updated using V4RB 11.4.5 then all is ok. But, if I update the same Vdatetime field, and then check for NULL again, I get a hard crash of my app in the debugger.

Here is the line of code where the crash occurs:
If cursor.DateTimeField(pnFld).IsNull Then

My question is to ask if there is something I need to do to the DateTime fields after conversion? I really can't believe that this is a bug in Valentina (although I wouldn't rule it out) because I would think others would have reported this long ago.

I am not having the same problems with my VDate fields.
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
Hello Steve,

Thank you, we’ll check it shortly.
コメント
There are no comments made yet.
Steve Albin 承諾済みの回答
I have added a report to Mantis that includes a test app and database. In my usage, the crash is reproducible every time. I hope this is helpful.
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
I opened the database in an application.
The last successfully executed line is
If cursor.DatetimeField(pnFld).IsNull Then

The one which crashed for me:
ElseIf (cursor.DateField(pnFld).Year = 0) Or (cursor.DateField(pnFld).Month = 0) Or (cursor.DateField(pnFld).Day = 0) Then

Change cursor.DateField with cursor.DatetimeField fixed the crash.
コメント
There are no comments made yet.
Steve Albin 承諾済みの回答
Thank you! I'm pleased this is solved and embarrassed that I could not see this myself. I had an incorrect understanding of how the Xojo debugger worked and thought the code was failing on the first If statement and never getting to the ElseIf. After fixing the line as you suggest, I now see that the debugger steps immediately to the Else condition that satisfies the condition and does not jump to each one to check.

That said, doesn't it seem that the app should not hard crash? Shouldn't an exception be thrown?
コメント
There are no comments made yet.
  • ページ :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.