1

I am using XOJO and pervasiveDB via ODBC. There is a form that I need to update and on that form I have a date field that can be deleted on the form. When the date is deleted on the form, I need it deleted in the DB as well.

I am using ODBC, and can't do it for some reason. I have tried sending NULL, nil, 0000-00-00 and it is simply not doing it.

I have even tried not to send it if the date is deleted hoping for the best, but it will simply not go away.

Any ideas?

4

2 回答 2

1

我想我解决了这个问题。这是解决方案:

在尝试了许多不同的事情之后,唯一可行的解​​决方案。

  dim inTYP as string = "6010-03"


SQLupdateBLIN = "update BLIN set inDAT=NULL  WHERE inTYP= '" + inTYP +"'"

如果我以以下格式发送 inDAT(将其作为变量发送),则它不起作用(没有错误,只是不起作用):

将 inDAT 调暗为 string = "NULL"

似乎 ODBC 不喜欢将值设置为 null 的变量。

于 2013-10-16T13:51:14.607 回答
0

使用直接 SQL 肯定会奏效。

如果您使用的是 RecordSet,那么您希望使用如下语法将列设置为 NULL:

MyRecordSet.Field("inDAT").Value = Nil

但是这是否有效完全取决于 ODBC 驱动程序。

于 2013-11-22T14:58:47.687 回答