Board index » delphi » Different results with VarIsNull

Different results with VarIsNull

Hi!

I got a database problem:

Using the exact same dbf data, VarIsNull on a field tests true on my
machine,
but tests false on the client's machine. Any ideas as to why?

OS is the same (Windows 95b)

Network OS is the same (Novell 4.1)

Thanks,

Elie

 

Re:Different results with VarIsNull


On Tue, 04 May 1999 17:30:27 GMT, Elie Tordjman <eto...@po-box.mcgill.ca>
wrote:

Quote
>I got a database problem:

>Using the exact same dbf data, VarIsNull on a field tests true on my
>machine,
>but tests false on the client's machine. Any ideas as to why?

>OS is the same (Windows 95b)

>Network OS is the same (Novell 4.1)

What about the TField.IsNull property?

//////////////////////////////////////////////////////////////////////////
Steve Koterski                   "There are two kinds of pedestrians...the
Technical Publications           quick and the dead."
INPRISE Corporation                            -- Lord Thomas Robert Dewar
http://www.borland.com/delphi                                  (1864-1930)

Re:Different results with VarIsNull


The IsNull property didn't seem to work either. Perhaps it might help
if you look at the code?

This is how it looks now with your suggestion, but it still executes the
code in the If block even though Query['CREDITACCT'] is Null.

If (not VarIsNull(Query['CREDITACCT'])) or (not
Query.FieldByName('CREDITACCT').IsNull) then begin

    ShowMessage('VarType: ' + IntToStr(VarType(Query['CREDITACCT'])));

End;

The ShowMessage will not execute on my machine, but will display
"VarType: 256" on the client's machine.

I've even gone so far as to have the contents of the Field copied to the
clipboard and pasted in a DOS box. It was a Smiley face.

Any suggestions will be greatly appreciated.  Thanks again,

Elie

Quote
Steve Koterski wrote:
> What about the TField.IsNull property?

> //////////////////////////////////////////////////////////////////////////
> Steve Koterski                   "There are two kinds of pedestrians...the
> Technical Publications           quick and the dead."
> INPRISE Corporation                            -- Lord Thomas Robert Dewar
> http://www.borland.com/delphi                                  (1864-1930)

Re:Different results with VarIsNull


1. Are you using the same EXE on both machines?
2. Are you absolutely positive that both machines are pathed to the same
location for the data?
3. What is the correct value for the field?
4. Are you using the same version of BDE on both machines?
Quote
Elie Tordjman wrote in message <372F2D8C.8C160...@po-box.mcgill.ca>...
>Hi!

>I got a database problem:

>Using the exact same dbf data, VarIsNull on a field tests true on my
>machine,
>but tests false on the client's machine. Any ideas as to why?

>OS is the same (Windows 95b)

>Network OS is the same (Novell 4.1)

>Thanks,

>Elie

Re:Different results with VarIsNull


Hi Bruce,

Thanks for writing.

To answer you questions:

Quote
Bruce Roberts wrote:
> 1. Are you using the same EXE on both machines?

Yes. I actually have a drive mapped to their server and I'm running
the same EXE that they are. But I've also had a copy of the EXE
and the data on my machine and have had the same results.

Quote

> 2. Are you absolutely positive that both machines are pathed to the same
> location for the data?

When this problem crept up, I was satisfied to take a copy of the entire
contents of their Data directory and try it locally. I decided to take your
question more literally and changed my path to point to their Data
directory.
Same results.

Quote

> 3. What is the correct value for the field?

The field specifies an account number to use IF a credit is being made
against a loan. This 8 character wide field can only contain
a Null or an account number (i.e. "25001130"). The code ends up
looking something like this:

If (not VarIsNull(Query['CREDITACCT'])) then begin
    // Code that credits the loan account...
End;

Quote

> 4. Are you using the same version of BDE on both machines?

Yes. Just confirmed with the client and we are both using V4.00

I have an idea as to what may cause the problem. It may have to
do with the data-entry screen. I'm going to check it out and post
back here.

If you have any insights that might solve this problem, my first two
boys will be named Bruce and Robert. Thanks in advance.

Elie

Quote

> Elie Tordjman wrote in message <372F2D8C.8C160...@po-box.mcgill.ca>...
> >Hi!

> >I got a database problem:

> >Using the exact same dbf data, VarIsNull on a field tests true on my
> >machine,
> >but tests false on the client's machine. Any ideas as to why?

> >OS is the same (Windows 95b)

> >Network OS is the same (Novell 4.1)

> >Thanks,

> >Elie

Re:Different results with VarIsNull


Hi. It's me replying to me for all who helped out.

I've tracked down the problem. Bruce Robert made me ask the client
what version of the BDE the were using, and what did they say?
"Version 4." Same as me. But when I got there this afternoon, I
checked it out myself and it was actually version 4.5!

So, as it turns out, VarIsNull returns False on an empty field when
using the BDE V4.5, but not when using V4.00 or, I was happy to
discover, V5.01, which I installed everywhere.

I also believe I compounded the problem by initializing a variable
to '' (empty string) then posting it to an Inserted record.

Thanks for your help Steve Koterski and Bruce Roberts.

-Elie Tordjman

Quote
Elie Tordjman wrote:
> Hi!

> I got a database problem:

> Using the exact same dbf data, VarIsNull on a field tests true on my
> machine,
> but tests false on the client's machine. Any ideas as to why?

> OS is the same (Windows 95b)

> Network OS is the same (Novell 4.1)

> Thanks,

> Elie

Other Threads