cannon_zhou
asked on
VB SP5 behaviors different from SP4
I recently upgraded to VB SP5 from SP4.
However, occationally, I found there are some functions changed.
Give you an example:
if rsEntry("Amount") = $102000.25
( rsEntry is an ADODB.Recordset object )
on VB SP4:
Code ' if rsEntry!Amount < ("99999.99")'
would return FALSE
But on VB SP5:
Code ' if rsEntry!Amount < ("99999.99")' returns TRUE
I have to use ' if rsEntry!Amount < CCur("99999.99")' to get the correct value 'FALSE'
I couldn't have any luck from internet, and on microsoft's web site it's all about .NET.
Have anybody seen similar problems, or had information related to VB SP5 according to the function changes.
Any idea ?
Thanks.
However, occationally, I found there are some functions changed.
Give you an example:
if rsEntry("Amount") = $102000.25
( rsEntry is an ADODB.Recordset object )
on VB SP4:
Code ' if rsEntry!Amount < ("99999.99")'
would return FALSE
But on VB SP5:
Code ' if rsEntry!Amount < ("99999.99")' returns TRUE
I have to use ' if rsEntry!Amount < CCur("99999.99")' to get the correct value 'FALSE'
I couldn't have any luck from internet, and on microsoft's web site it's all about .NET.
Have anybody seen similar problems, or had information related to VB SP5 according to the function changes.
Any idea ?
Thanks.
You should include the CCur Function in your comparison as the compare value is a String.
ASKER
The datatype of rsEntry("Amount") is a currency field.
Hi cannon_zhou,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:
Refund points and save as a 0-pt PAQ.
cannon_zhou, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit. Explain why.
==========
DanRollins -- EE database cleanup volunteer
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:
Refund points and save as a 0-pt PAQ.
cannon_zhou, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit. Explain why.
==========
DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
from what i see, it is a String (are you storing the $)
if so, i'd suggest against that and just store it as a number.