Issues With Vbnullstring And Vista

jaydwest

JayW
Local time
Yesterday, 22:26
Joined
Apr 22, 2003
Messages
340
I recently updated some A2K databases to A2K3 on a Vista computer. Suddenly all my databases were crashing and throwing wierd error messages like field '' not found and form '' not found.

I tracked the problem down to the use of vbNullString. When I replaced all the vbNullStrings in my code with "", the problems seem to have disappeared.

Has anyone else seen this issue or am I just gifted?

Thanks
 

ajetrumpet

Banned
Local time
Yesterday, 23:26
Joined
Jun 22, 2007
Messages
5,638
I recently updated some A2K databases to A2K3 on a Vista computer. Suddenly all my databases were crashing and throwing wierd error messages like field '' not found and form '' not found.

I tracked the problem down to the use of vbNullString. When I replaced all the vbNullStrings in my code with "", the problems seem to have disappeared.

Has anyone else seen this issue or am I just gifted?

Thanks
You're probably just gifted. :) I don't know anything about this, but I've answered questions in the past where VBA syntax had slightly changed for Access between versions, and the poster didn't know it. I think a switch between any two versions will have syntax changes associated with it. It just depends on if you are lucky enough to experience it.

I don't know if this was the problem. Just spreading some knowledge around... :)
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 05:26
Joined
Sep 12, 2006
Messages
15,701
thats really surprising, since it should be the other way round

ie vbnullstring should be guaranteed to work, rather than explicitly """
 

Rabbie

Super Moderator
Local time
Today, 05:26
Joined
Jul 10, 2007
Messages
5,906
thats really surprising, since it should be the other way round

ie vbnullstring should be guaranteed to work, rather than explicitly """
This may explain the difference.
result of a Google Search said:
vbNullString is a special VB constant that denotes a null string. The "" literal is an empty string. There's an important difference. An empty string is a real string. A null string is not. It is just a zero. If you know the C language, vbNullString is the equivalent of NULL.
This may explain the difference in behaviour.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 05:26
Joined
Sep 12, 2006
Messages
15,701
i thought the use of vb constants was recommended to avoid side effects

eg vbcancel, rather than explicitly 0 or 1, or whatever it happens to be
and vbnullstring, rather than an explicit string

as these were guaranteed to work, however MS actually implemented the language.
As rabbie says, a zls in c is different from one in pascal

so perhaps MS have changed the implementaion of zls in Access2007. In that case it might be that you have saved something by explicitly assigning it the value "", but then compared it with vbnullstring, which is now implemented differently.

does anyone know? will loads of things in A2007 stop working as expected?
 

Users who are viewing this thread

Top Bottom