Re: Access conversion to SQL
- From: <david@epsomdotcomdotau>
- Date: Tue, 3 Apr 2007 20:27:37 +1000
problems, MsSql doesn't. I can't even use the words True or False
in an sql statement.
I don't have any trouble using the words True and False
in a MSsql statement.
chkAdmin.Checked = GetField("select admin from users where
username='Bert';", "admin")
That works for me: you will have to be more careful with the
way you write GetField.
Access/Jet/Intel/ and others use -1 as True.
MS SQL/ C/ Digital/ and others used +1 as True.
Access/Jet will correctly translate Boolean values as long as you are
careful to only use them as Boolean's (not as numbers).
Alternatively, you can choose to only use numbers (0,1 Null), so
that your SQL is clearer, more exact, and more portable, but then
you won't be able to depend on the sign of TRUE.
Many people choose to only use FALSE (note that it has the
same value in both systems). They use NOT FALSE instead of
TRUE.
Many people choose to only use numbers instead of Booleans.
It is a real problem, but nobody solves it by using "two loads
of code". If you are doing that, you are doing something wrong.
(david)
"tclancey" <tull@xxxxxxxxxxxxxxxx> wrote in message
news:OKDimXUdHHA.208@xxxxxxxxxxxxxxxxxxxxxxx
Hi all.the
I have an application that currently connects to an Access database, now
customers are asking for a MySql and MsSql server back end database.Sql
MySql handles True and False values through the bit field without any
problems, MsSql doesn't. I can't even use the words True or False in an
statement.extra
This means I have to write two loads of code for every transaction where
there is a true/false value involved, a complete pain.
It also gives me the problem of setting controls true/false value by
checking a table field:
chkAdmin.Checked = GetField("select admin from users where
username='Bert';", "admin")
(Get field is a routine that loads a data record and returns the field as
the second parameter)
As SQL never returns a true or false value in this way I have to write
code for every check, or checked list, etc.
Is there a way around this?
Cheers,
Tull.
.
- Follow-Ups:
- Re: Access conversion to SQL
- From: Aaron Kempf
- Re: Access conversion to SQL
- References:
- Access conversion to SQL
- From: tclancey
- Access conversion to SQL
- Prev by Date: I never wanted to participate;how can I remove myself--so I NO LONGER RECEIVE ANY E-MAILS FROM SAME?????from:lorenechristy@comcast.net????
- Next by Date: reading .mdb in access 97 format
- Previous by thread: Access conversion to SQL
- Next by thread: Re: Access conversion to SQL
- Index(es):
Relevant Pages
|