473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Bit fields with Access97 and SQL2000

Hi

Sorry in advance for my english. I hope you'll understand me.

I have an application devoloped by MSAccess97 with MSSQLserver 7.0.
Now, I have to change DB from MSSQLserver 7.0 to MSSQL2000,
but unfortunately I have some problems with bit fields, because the new OBDC
considers 1 the value bit fields instead -1 as the old ODBC of SQL7.
So there are a lot query in combobox, query and code to compare the value
as -1
and I can't exctract any data.

Is it possible? Anyone's had the same problem?

In Microsoft web site I didn't forund anything about this problems.
Can you send me any link about this problem?

Thanks
Bye
Eugenio
Nov 13 '05 #1
6 1938
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The Bit data type can only hold 1, 0 or NULL. If you want to have -1 as
a value you must convert the data type from Bit to Smallint. If you do
that on the current data, afterwards you will have to change all 1s to
1s - use an UPDATE statement.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQlG0y4echKqOuFEgEQKPogCbBwy5lN/NJ60sf4ZdwgGuSlzPfkEAoIGd
QWXNVneDtMLS/w3ljcTharHm
=3tSx
-----END PGP SIGNATURE-----
Eugenio wrote:
Hi

Sorry in advance for my english. I hope you'll understand me.

I have an application devoloped by MSAccess97 with MSSQLserver 7.0.
Now, I have to change DB from MSSQLserver 7.0 to MSSQL2000,
but unfortunately I have some problems with bit fields, because the new OBDC
considers 1 the value bit fields instead -1 as the old ODBC of SQL7.
So there are a lot query in combobox, query and code to compare the value
as -1
and I can't exctract any data.

Is it possible? Anyone's had the same problem?

In Microsoft web site I didn't forund anything about this problems.
Can you send me any link about this problem?

Nov 13 '05 #2
On Mon, 04 Apr 2005 21:42:23 GMT, MGFoster <me@privacy.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The Bit data type can only hold 1, 0 or NULL. If you want to have -1 as
a value you must convert the data type from Bit to Smallint. If you do
that on the current data, afterwards you will have to change all 1s to
1s - use an UPDATE statement.


Actually, Jet usually maps bit fields to -1/0 so they'lll work correctly with
check box controls and such. I'm not sure why that is not happening in this
case.
Nov 13 '05 #3
Steve Jorgensen wrote:
On Mon, 04 Apr 2005 21:42:23 GMT, MGFoster <me@privacy.com> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The Bit data type can only hold 1, 0 or NULL. If you want to have -1 as
a value you must convert the data type from Bit to Smallint. If you do
that on the current data, afterwards you will have to change all 1s to
1s - use an UPDATE statement.

Actually, Jet usually maps bit fields to -1/0 so they'lll work correctly with
check box controls and such. I'm not sure why that is not happening in this
case.


Yeah, but it wasn't JET he converted from; he converted from SQL Server
7.0 to SQL Server 2000. According to BOL that's where the conversion of
negative 1 to positive 1 took place.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #4
"MGFoster" <me@privacy.com> wrote in message
news:Id***************@newsread3.news.pas.earthlin k.net...
Steve Jorgensen wrote:
On Mon, 04 Apr 2005 21:42:23 GMT, MGFoster <me@privacy.com> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The Bit data type can only hold 1, 0 or NULL. If you want to have -1 as
a value you must convert the data type from Bit to Smallint. If you do
that on the current data, afterwards you will have to change all 1s to
1s - use an UPDATE statement.

Actually, Jet usually maps bit fields to -1/0 so they'lll work correctly with
check box controls and such. I'm not sure why that is not happening in this
case.


Yeah, but it wasn't JET he converted from; he converted from SQL Server 7.0 to
SQL Server 2000. According to BOL that's where the conversion of negative 1
to positive 1 took place.


We first started using SQL Server at version 6.5 and it was already using
positive one for bit fields. Perhaps the change that is really causing the
problem is the change that made bit fields nullable. That definitely was
changed after 6.5.

I found in 6.5 that even though Access presented True bit fields as a negative
one that tests against the field for "True" or -1 or 1 were all unreliable.
Ever since I have always tested for =0 or <>0.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #5
"Rick Brandt" <ri*********@hotmail.com> wrote in
news:AX****************@newssvr11.news.prodigy.com :
I found in 6.5 that even though Access presented True bit fields
as a negative one that tests against the field for "True" or -1 or
1 were all unreliable. Ever since I have always tested for =0 or
<>0.


Actually, that is the way True/False are implemented in Jet and VBA.
True actually *does* mean <>0. Take this example:

IIf(InStr("12345","5"),"True","False")

It returns the string "True," even though if you test it against the
value of True, it returns False.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #6
David W. Fenton wrote:
"Rick Brandt" <ri*********@hotmail.com> wrote in
news:AX****************@newssvr11.news.prodigy.com :
I found in 6.5 that even though Access presented True bit fields
as a negative one that tests against the field for "True" or -1 or
1 were all unreliable. Ever since I have always tested for =0 or
<>0.


Actually, that is the way True/False are implemented in Jet and VBA.
True actually *does* mean <>0. Take this example:

IIf(InStr("12345","5"),"True","False")

It returns the string "True," even though if you test it against the
value of True, it returns False.


Yes I was aware of that. I just found that against Jet tables I could
use...

SELECT * FROM TableName
WHERE YesNoField = -1

....and it was reliable whereas it was not reliable against a SQL Server
linked table. In fact if I clicked in a SQL Server linked field that was
displaying -1 and used the filter tool "Filter by Selection" it would not
work. I assume because it was passing "WHERE foo = -1" to the server and
the server was not finding any such records even though that is how Access
was displaying them.

*Sometimes* I could filter for =1 and even though I could clearly "see" no
records with that value it would return all the -1 values. That behavior
was not consistent though. =0 and <>0 were the only criteria I found that
worked 100 percent of the time.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob | last post by:
I have an application written in Access 97 that connects to a SQL2000 backend. One field is a description field that is a data type NTEXT in the SQL database. In my access form, I can not enter...
4
by: Martin Lacoste | last post by:
(Access 2000) Two issues: Within a query, I need to return a field name as data (see eg. below). I need to search within 80 fields (same criteria) - is there a way to avoid 80 separate...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
8
by: Rebecca | last post by:
We are converting my Access97 back end to SQL Server and almost have it all working. The current problem has to do with one situation in which I have to programmatically (still in the Access97...
0
by: lesperancer | last post by:
I've got a sql server view that returns data, as a linked table to access97 (qryPlannedPurPT) this link table is used in an access query (qryPlannedPUR) that uses all of the linked table fields...
3
by: Alan Carpenter | last post by:
Hi. In Access97 I can set defaults for new Fields in Tools - Options - Tables/Queries. I can set some Form/Report defaults in the Normal Template. Now I need to work with AllowZeroLength =...
10
by: lesperancer | last post by:
you start with a small application in access97, then you have more modules and more... and you reach the point where tables like 'item' and 'employee' reach the limit and you know there's more...
7
by: jc | last post by:
Hello, a question for the MS Access community, from someone who programs with SQL in SQL2000. I currently create a table with varying column names and data within SQL2000. I then need to...
2
by: Roger | last post by:
I've got two tables in sql2005 which have an 'ntext' field when I linked the first table in access97 last week using an odbc data source the access-field type was 'memo' when I link the 2nd...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.