By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,514 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,514 IT Pros & Developers. It's quick & easy.

When is a boolean not a boolean?

P: n/a
I have a strange one that's making me scratch my head.

The app is written in AccessXP. The table is a FoxPro 2.6 table. I
link to it via ODBC. There is a field called Active, type Logical
(boolean) in FoxPro.

I have a query where I select OrderID and Active. It presents the
records fine.

If I enter False or True for the criteria of Active, no records are
returned.

If I create an expression like
Expr1:[Active] = 0
or
Expr1:[Active] = -1
the results in that column are 0 or -1 depending on whether or not
Active is true or false as I would expect. Yet if I put in True or
False in the expression's Criteria row no records are returned.

Is this an ODBC problem? Although the 0 or -1 appear to be numbers is
it possible it considers the value of Active as a string or a double or
some other thing?

What confounds me is that it works fine in A97....but A97 doesn't use
the ODBC for FoxPro tables...it uses some Isam drivers.

Do you have any suggestions for debugging this "feature"?

Nov 13 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Salad, Don't know the answer to your question, but have you tried using 0
or -1 as the criteria in the query? Just wondering!

--
Reggie

----------
"Salad" <oi*@vinegar.com> wrote in message
news:W_******************@newsread2.news.pas.earth link.net...
I have a strange one that's making me scratch my head.

The app is written in AccessXP. The table is a FoxPro 2.6 table. I
link to it via ODBC. There is a field called Active, type Logical
(boolean) in FoxPro.

I have a query where I select OrderID and Active. It presents the
records fine.

If I enter False or True for the criteria of Active, no records are
returned.

If I create an expression like
Expr1:[Active] = 0
or
Expr1:[Active] = -1
the results in that column are 0 or -1 depending on whether or not
Active is true or false as I would expect. Yet if I put in True or
False in the expression's Criteria row no records are returned.

Is this an ODBC problem? Although the 0 or -1 appear to be numbers is
it possible it considers the value of Active as a string or a double or
some other thing?

What confounds me is that it works fine in A97....but A97 doesn't use
the ODBC for FoxPro tables...it uses some Isam drivers.

Do you have any suggestions for debugging this "feature"?

Nov 13 '05 #2

P: n/a
Reggie wrote:
Salad, Don't know the answer to your question, but have you tried using 0
or -1 as the criteria in the query? Just wondering!

Yes. I tried that, same results. As long as I don't have a WHere
clause I get records. If I try to filter on True/False or 0,-1 there
are no records returned.

Nov 13 '05 #3

P: n/a
Reggie wrote:
Salad, Don't know the answer to your question, but have you tried using 0
or -1 as the criteria in the query? Just wondering!


Hmmm...I entered
Expr1 : CInt([Active])
and in the criteria row True or False and I get records. This seems odd
since I have entered
Expr2 : [Active] = True
and depending on whether or not Active is True or False I get 0 or -1
and the values are correct.
Nov 13 '05 #4

P: n/a
also try <>0, 1, <>1 <>True <>False

"Salad" <oi*@vinegar.com> wrote in message
news:HI******************@newsread2.news.pas.earth link.net...
Reggie wrote:
Salad, Don't know the answer to your question, but have you tried using 0 or -1 as the criteria in the query? Just wondering!

Yes. I tried that, same results. As long as I don't have a WHere
clause I get records. If I try to filter on True/False or 0,-1 there
are no records returned.

Nov 13 '05 #5

P: n/a
david epsom dot com dot au wrote:
also try <>0, 1, <>1 <>True <>False
Yeah. I tried that. I tried all varieties of methods on it. It is
interesting. I created a new table with 4 or 5 records and it worked
fine. But if I open the FoxPro table I am having trouble with and copy
the field OrderID and Active to a new table and index on OrderID, this
table has about 58K records and Access bombs on understanding the
boolean field.

What blows me away is that if I enter
Expr1 : CInt(Active)
then it works. Now why would that make a difference when if I enter
Expr2 : [Active] = 0
and if Active is False, Expr2 is -1 and 0 if Active is True?

This tells me that my ODBC driver is braindead. That MS can't make ODBC
work with its own products.

Since I am using AccessXP for this I looked at the version of the FoxPro
VFP OCBC driver I am using. It is dated 9/21/1999 and is version
6.01.8629.01. It's quite possible this driver is old, unsupported, is
not backward compatable, and that AccessXP being more modern is
reading/using it and gets confused and burps.

Hopefully I can find a VFP ODBC driver at Microsoft. I'm not sure if MS
uses ODBC anymore or where they would have it on their site. With my
luck I'll get a newer ODBC driver that AccessXP doesn't recognize and
burps again.


"Salad" <oi*@vinegar.com> wrote in message
news:HI******************@newsread2.news.pas.earth link.net...
Reggie wrote:
Salad, Don't know the answer to your question, but have you tried using
0
or -1 as the criteria in the query? Just wondering!


Yes. I tried that, same results. As long as I don't have a WHere
clause I get records. If I try to filter on True/False or 0,-1 there
are no records returned.



Nov 13 '05 #6

P: n/a
Salad <oi*@vinegar.com> wrote in message news:<W_******************@newsread2.news.pas.eart hlink.net>...
I have a strange one that's making me scratch my head.
...
What confounds me is that it works fine in A97....but A97 doesn't use
the ODBC for FoxPro tables...it uses some Isam drivers.

Do you have any suggestions for debugging this "feature"?


You could force the dll used in A97 for the Isam drivers to be used in AXP ;-).

James A. Fortune
Nov 13 '05 #7

P: n/a
James Fortune wrote:
Salad <oi*@vinegar.com> wrote in message news:<W_******************@newsread2.news.pas.eart hlink.net>...
I have a strange one that's making me scratch my head.
...
What confounds me is that it works fine in A97....but A97 doesn't use
the ODBC for FoxPro tables...it uses some Isam drivers.

Do you have any suggestions for debugging this "feature"?

You could force the dll used in A97 for the Isam drivers to be used in AXP ;-).

James A. Fortune


How would one do that?

Nov 13 '05 #8

P: n/a
Hi "Salad",

These are just random thoughts, as I have never personally encountered this.

Have you looked in the OBDC / OBDC32 section of the Control Panel?
That may provide you with some insight as to what you're missing, or don't
have configured perhaps?
Don

Salad <oi*@vinegar.com> wrote in message
news:9M*******************@newsread2.news.pas.eart hlink.net...

This tells me that my ODBC driver is braindead. That MS can't make ODBC
work with its own products.


Nov 13 '05 #9

P: n/a
Don Leverton wrote:
Hi "Salad",

These are just random thoughts, as I have never personally encountered this.

Have you looked in the OBDC / OBDC32 section of the Control Panel?
That may provide you with some insight as to what you're missing, or don't
have configured perhaps?
Don


Hi Don: Let me tell you how I do this. I could easily be doing
something wrong. Opening my links on my development machine are
atrociously slow. I have a 2.6 gz machine, 1 gig memory, lots of disk
space, Access2000 has sp3 installed.

I get the ODBC administrator open. I click System DSN. I click Add. I
then select the VFP driver and click Finish. I enter Test for both
Data Services name and description. I select FreeTable, not DBC (VFP
can be a DBC or use dbf tables) and enter the path C:\Test as the path.
I click Options; machine collate. The Null, Deleted, and Fetch data
in background (defaults) are checked. I click Finish. This is real quick.

I have a customer table with 167 records. I open up Access2000, click
File/GetExternalData/Link, select ODBC, select Test dsn. After about 5
seconds (slow) the tables in that directory appear. I select Customer.
After 5-10 seconds it presents me with a list of fields that make the
unique index key. I select CustomerID and OK. I now have a link.

When I click on the customer table and press Open in A2K it takes about
1 minutes 15 seconds to open it. I have AutoCorrect set off.

I'm wondering at this point if I can even work on this application. On
my clients machine it is not as slow as mine. It takes about 1-3
seconds to open the customer file and maybe 5-10 to open the orderlog
file. I have not even attemped to open it on my machine as it has 58K
records.

If I open up the customer table the primary key is type decimal. What I
find intriguing is that ALL text fields are set to Required = Yes, Allow
zero length = Yes.

I imported the data instead of linked to it and pulling up the records
is instantaneous....as expected. I'm pulling my hair out on this
on...what little hair I have. If I use A97 and the ISAM driver, pulling
up the tables is instantaneous.

Can you see anything that I am doing wrong?

Nov 13 '05 #10

P: n/a
Hi,

Like I said, I really don't know a whole bunch about this.
My suggestion was to have a look at the OBDC applet in the control panel to
see what information could be gleaned.

There is a whole lot of information presented there, i.e driver versions and
dates, etc.

I'm at work right now, where we have 2 networked PC's. One of them has
Win98SE and the other is running WinXP.

Win98: Control Panel / ODBC Data Sources (32bit)
WinXP: Control Panel / Admin Tools / Data Sources (ODBC)

Just for an example, in comparing the two I see that the W98 machine uses:
M/S VFP driver, ver 6.00.8428.00, vfpodbc.dll, 04/06/1999

and the XP machine uses:
M/S VFP driver, ver 1.00.02.00, vfpodbc.dll, 08/28/2002

I don't know what the significance of the difference between the 2 is
however ...
My thought was that you could get this kind of information, and use it to
research your problem further.

Best of luck with that, BTW.
Don

Salad <oi*@vinegar.com> wrote in message
news:3Q*******************@newsread2.news.pas.eart hlink.net...
Hi Don: Let me tell you how I do this. I could easily be doing
something wrong.

Nov 13 '05 #11

P: n/a
Don Leverton wrote:
Hi,

Like I said, I really don't know a whole bunch about this.
My suggestion was to have a look at the OBDC applet in the control panel to
see what information could be gleaned.

There is a whole lot of information presented there, i.e driver versions and
dates, etc.

I'm at work right now, where we have 2 networked PC's. One of them has
Win98SE and the other is running WinXP.

Win98: Control Panel / ODBC Data Sources (32bit)
WinXP: Control Panel / Admin Tools / Data Sources (ODBC)

Just for an example, in comparing the two I see that the W98 machine uses:
M/S VFP driver, ver 6.00.8428.00, vfpodbc.dll, 04/06/1999

and the XP machine uses:
M/S VFP driver, ver 1.00.02.00, vfpodbc.dll, 08/28/2002
Thanks Don. I had the same driver, 1.00.02.00, on my MS VFP driver. It
wouldn't allow me to create a User/system dsn...it told me to go to go
to the Microsoft site and download the most current one...which I did is
is v8.01.8629.01 dated 12/7/1999. I can at least create a dsn but it is
so slow as to be what I consider worthless.

I have a mantra I repeat every so often: Microsoft giveth and Microsoft
taketh away. The ISAM driver in A97 was great. So of course that has
to be removed so as to give developers a piece of crud using an ODBC
driver. Sorry for the rant, guess I'm frustrated.

I don't know what the significance of the difference between the 2 is
however ...
My thought was that you could get this kind of information, and use it to
research your problem further.

Best of luck with that, BTW.
Don

Salad <oi*@vinegar.com> wrote in message
news:3Q*******************@newsread2.news.pas.eart hlink.net...
Hi Don: Let me tell you how I do this. I could easily be doing
something wrong.



Nov 13 '05 #12

P: n/a
Salad <oi*@vinegar.com> wrote in message news:<Fa***************@newsread1.news.pas.earthli nk.net>...
James Fortune wrote:
Salad <oi*@vinegar.com> wrote in message news:<W_******************@newsread2.news.pas.eart hlink.net>...
I have a strange one that's making me scratch my head.
...
What confounds me is that it works fine in A97....but A97 doesn't use
the ODBC for FoxPro tables...it uses some Isam drivers.

Do you have any suggestions for debugging this "feature"?

You could force the dll used in A97 for the Isam drivers to be used in AXP ;-).

James A. Fortune


How would one do that?


I encountered this situation when A97 was used to link to FoxPro
tables and the company upgraded to A2K. A2K dropped the Isam
capability to link the FoxPro tables so I simply found the dll in A97
that did the Isam. I either replaced the dll or added the dll to A2K
and was able to link the FoxPro tables again. I don't know if this
would work in AXP.

James A. Fortune
Nov 13 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more Microsoft Access / VBA Questions on Bytes