[AccessD] db execute on linked vs local table

Ryan W wrwehler at gmail.com
Mon Jan 31 15:13:57 CST 2022


More info:

If I set the column to not allow nulls, db.execute tries to set it as NULL
but then a prepared statement comes in after the fact and does indeed set
it to true.

https://i.imgur.com/m8TSBN6.png

On Mon, Jan 31, 2022 at 2:40 PM Ryan W <wrwehler at gmail.com> wrote:

> Upon more testing it seems like FALSE (without quotes) works as well. It
> just seems to be TRUE (no quotes) sets my remote bit column to NULL.
>
> Here's a SQL Profiler:
>
> https://i.imgur.com/rVx3vmX.png
>
>
>
>
>
> On Mon, Jan 31, 2022 at 1:48 PM Ryan W <wrwehler at gmail.com> wrote:
>
>> Is there a reason db.execute syntax is a bit different on a linked (ODBC)
>> vs local (DAO?)
>>
>> db.execute "UPDATE tbl SET col_A = TRUE" works as expected locally.
>>
>> where run on a linked table, it NULLs out the bit field.
>>
>> but db.execute "UPDATE tbl set col_A = 'TRUE'"  or db.execute "UPDATE tbl
>> set col_A = 1" works remotely and the numerical representation of
>> true/false works both remote AND locally.
>>
>> However 'TRUE' or 'FALSE' with the single quotes on a local table gives a
>> data type mismatch (which makes sense, because it's treating it as a
>> literal and not converting it to 1/0.
>>
>>
>> I guess my question is, is it the difference in the DAO engine vs the
>> ODBC layer that is turning my BIT field NULL (linked) versus local?
>>
>>
>>
>>
>>


More information about the AccessD mailing list