在由Access資料庫轉為MySQL時,水晶報表出現了嚴重的錯誤:CrystalDecisions.CrystalReports.Engine.LogOnException:登錄失敗,然而卻僅是我要轉換報表中的一支獨秀
在Access資料庫時,資料來源選用OLEDB,其SQL命令如下:SELECT distinct as01.acccode, as01.accname, 0.00 , 0.00,0.00, 0.00, 0.00,0.00,0.00,0.00,as01.cditem,'',acode,iif(aspace is null,0,aspace)
FROM as01
ORDER BY as01.acccode;
在轉成MYSQL資料庫時,資料來源選用ODBC,其SQL命令如下:SELECT distinct as01.acccode, as01.accname, 0.00 as a, 0.00 as b,0.00 as c, 0.00 as d, 0.00 as e,0.00 as f,0.00 as g,0.00 as h,as01.cditem,'',acode,if(aspace is null,0,aspace) as aspace
FROM as01
ORDER BY as01.acccode;
由於要使用公式,所以MYSQL的水晶報表對連續的0.00是無法區分的,當好心給各欄取個別名時就犯上面的傻啦@_@,而且公式在使用0.00時都當成字符型..=.=..查了相關“登錄失敗”的信息,卻沒有對號入座的(http://alltang.com/content.aspx?id=87)真是百思不得其解。。。
當嘗試改為:SELECT distinct as01.acccode, as01.accname, 1, 2,3, 4,5,6,7,8,as01.cditem,'' AS Expr1011,acode,if(aspace is null,0,aspace) as aspace
FROM as01
ORDER BY as01.acccode;這支獨秀才高興地秀出我要的資料來。。。。。。^__^