[AccessD] upsizing

Charlotte Foust cfoust at infostatsystems.com
Thu Jul 31 19:51:13 CDT 2008


In Access, that's true.  In SQL Server, 1 is true and 0 is false.  If
you throw a -1 at it, it spits up all over you.

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Thursday, July 31, 2008 3:03 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] upsizing

With the BE I just upsized, all the Yes/No fields became bits.  I went
through all those fields and set Allow Nulls to False.

Now the only to values that can be entered into the bit fields are -1
and 0.

I set up a recordset to change iteratively change the value from True to
False then True then False, etc, and everything worked just as if I had
been using an Access table.

I went back and tested one field by setting Allow Nulls to True.  My
code then displayed the value as False if I set the field to Null in
code.

Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Thursday, July 31, 2008 4:37 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] upsizing

Hi Charlotte

One way to get around this - if you really need to handle the value as a
numeric - is to use Abs():

  If Abs([YourYesNoField]) = 1 Then
    ' something
  End If

Another is to use DataTableAdapters and/or DAL to isolate you from this
low-level stuff. I couldn't imagine anything else than this is what you
do, but your reply indicates not. Is that really so?

/gustav

>>> cfoust at infostatsystems.com 31-07-2008 17:25 >>>
We have to be careful in our .Net code to always test for 0 or <> 0
because we run against both Access and SQL Server.  Trying to test for
True crashes on one or the other.

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Wednesday, July 30, 2008 4:48 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] upsizing

oooooooooooooo.... I like that. :)

Susan H.


> Possiby because Access uses -1  for True and you can't represent that 
> with a bit?
>
> What value does SSMA store insert a True record (1 or -1)?
>
>
> On 30 Jul 2008 at 18:45, Susan Harkins wrote:
>
>> SSMA converts Access Yes/No fields to tinyint, instead of bit -- does

>> anyone have an explanation for that?
>>
>> My guess is it's because SQL Server's bit didn't support NULL's until

>> 7.0, but it seems like the wizard would keep up with something like 
>> that. I really can't recall if Access' Yes/No always supported NULLs 
>> or not.
>>
>> Susan H.



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list