Cricinfo Live Scores

Saturday, March 22, 2008

VBA: 255 string length problem

I had a very strange experience with my VBA application of MIS.
Two days past away but there was no solution for this problem.
The problem was my query length was crossing 255 characters length
and i was receiving error in the vba.

But, most interesting thing after a long investigation i discovered that
actually string length is not fixed to 255. Actually vba does not have
such kind of problems.

The problem was that i was using debugger to go through my logic paths
as i always do when testing application result; i was just investigating
my string length the debugger.

And, every time it was limited to 255 chars. Very unusual! When i get bored
and let the program to run for anything then i saw that my operation was
successful.

So, i come to the solution there is no problem with string length in VBA. Actually
debugger is not able to show you the string value over 255 chars.

It was a happy moment for me. So much pain i had gone through for that string......

Happy Programming.

Author
Kazi Masudul Alam
Software Engineer