Tuesday, August 19, 2008

leading 000 are important in programming

All seemed working in a AJAX, we tested with some user IDs and it worked, however when our customers log in, they get an error which indicates the correct flag which IS in database is not picked up.

It is not http/https difference nor AJAX not working,

when I wrote the code, the sMU_id returned from Database is varchar2 so can be 01112222, however when it was assigned to mu_id this 0 (if there is one) is lost as the default type of vbscript is chosen automatically as number!!!

asp由于自动类型,把赋进来的字符串(可能以0开头)变为了数值,所以丢了0,再返回数据库作sql查询时,自然查不出来了。我们测试的id都是非0开头,所以没察觉这个问题。

Response.Write("var mu_id; mu_id="" "";mu_id="""&sMU_id & """;"& vbCrLf )

0 Comments:

Post a Comment

<< Home