0
我在從子句中訪問數據時從MS Access數據庫中的語法錯誤但如果我在訪問中運行相同的查詢我得到所需的結果沒有任何錯誤。在C#中的FROM子句中的語法錯誤(MS Access)
任何幫助表示讚賞。 這是我的代碼
string strQuery = string.Empty ;
strQuery = "SELECT TUCLRII.LUSID,TUCLRII.UserID,TUCLRII.LastName,TUCLRII.FirstName,TUCLRII.MI,TUCLRII.Sex,TUCLRII.WhichEye,TUCLRII.Memo1,TUCLRII.Memo2,TUCLRII.CreationDT, TUCLRII.LastModifiedDT,TUCLRII.CardID,TUCLRI.UCID,TUCLRII.WiegandData,TUCLRII.LIrisCodeID,TUCLRII.LWhichEye,TUCLRII.LIrisCode,TUCLRII.RIrisCodeID,TUCLRII.RWhichEye,TUCLRII.RIrisCode,TUCLRII.LIrisImage,TUCLRII.LImageFormat,TUCLRII.LImageSize,TUCLRII.LWhichEye,TUCLRII.RIrisImage,TUCLRII.RImageFormat,TUCLRII.RImageSize,TUCLRII.RWhichEye,TIM.ImageFormat,TIM.ImageSize,TIM.FaceImage,TIM.PictureTakenDT";
strQuery += " FROM (SELECT TUCLRI.LUSID,TUCLRI.UUID,TUCLRI.UserID,TUCLRI.LastName,TUCLRI.FirstName,TUCLRI.MI,TUCLRI.Sex,TUCLRI.WhichEye,TUCLRI.Memo1,TUCLRI.Memo2,TUCLRI.CreationDT,TUCLRI.LastModifiedDT, TUCLRI.CardID, TUCLRI.UCID, TUCLRI.WiegandData, TUCLRI.LIrisCodeID ,TUCLRI.LWhichEye,TUCLRI.LIrisCode,TUCLRI.RIrisCodeID,TUCLRI.RWhichEye,TUCLRI.RIrisCode,TUCLRI.LIrisImage,TUCLRI.LImageFormat,TUCLRI.LImageSize,TUCLRI.LWhichEye,TRIM.IrisImage as RIrisImage,TRIM.ImageFormat as RImageFormat, TRIM.ImageSize as RImageSize, TRIM.WhichEye as RWhichEye";
strQuery += " FROM (SELECT TUCLR.LUSID,TUCLR.UUID,TUCLR.UserID,TUCLR.LastName,TUCLR.FirstName,TUCLR.MI,TUCLR.Sex,TUCLR.WhichEye,TUCLR.Memo1,TUCLR.Memo2,TUCLR.CreationDT,TUCLR.LastModifiedDT,TUCLR.CardID,TUCLR.UCID,TUCLR.WiegandData,TUCLR.LIrisCodeID,TUCLR.LWhichEye,TUCLR.LIrisCode,TUCLR.RIrisCodeID,TUCLR.RWhichEye,TUCLR.RIrisCode,TLIM.IrisImage as LIrisImage,TLIM.ImageFormat as LimageFormat,TLIM.ImageSize as LImageSize,TLIM.WhichEye as LWhichEye";
strQuery += " FROM (SELECT TUCI.LUSID,TUCI.UUID,TUCI.UserID,TUCI.LastName,TUCI.FirstName,TUCI.MI,TUCI.Sex,TUCI.WhichEye,TUCI.Memo1,TUCI.Memo2,TUCI.CreationDT,TUCI.LastModifiedDT,TUCI.CardID,TUCI.UCID,TUCI.WiegandData, TUCI.LIrisCodeID,TUCI.LWhichEye,TUCI.LIrisCode,TRI.IrisCodeID as RIrisCodeID,TRI.WhichEye as RWhichEye,TRI.IrisCode as RIrisCode";
strQuery += " FROM (SELECT TUC.LUSID,TUC.UUID,TUC.UserID,TUC.LastName,TUC.FirstName,TUC.MI,TUC.Sex,TUC.WhichEye,TUC.Memo1,TUC.Memo2,TUC.CreationDT,TUC.LastModifiedDT,TUC.CardID,TUC.UCID,TUC.WiegandData,TLI.IrisCodeID as LIrisCodeID,TLI.WhichEye as LWhichEye,TLI.IrisCode as LIrisCode";
strQuery += " FROM (SELECT TU.LUSID,TU.UUID,TU.UserID,TU.LastName,TU.FirstName,TU.MI,TU.Sex,TU.WhichEye,TU.Memo1,TU.Memo2,TU.CreationDT,TU.LastModifiedDT,TC.CardID,TC.UCID,TC.WiegandData FROM UserInfo TU left join CardInfo TC on (TU.UUID=TC.UUID and TU.LUSID = 0)) TUC LEFT JOIN IrisCodeInfo TLI ON(TUC.UUID = TLI.UUID and TLI.WhichEye=1))TUCI LEFT JOIN IrisCodeInfo TRI ON(TUCI.UUID = TRI.UUID and TRI.WhichEye=2))TUCLR LEFT JOIN IrisImageInfo TLIM ON(TUCLR.UUID = TLIM.UUID and TLIM.WhichEye=1))TUCLRI LEFT JOIN IrisImageInfo TRIM ON(TUCLRI.UUID = TRIM.UUID and TRIM.WhichEye=2))TUCLRII LEFT JOIN FaceImageInfo TIM ON(TUCLRII.UUID = TIM.UUID)";
多個FROM子句? – 2011-05-17 06:41:38
@ Will A:是的...... – user662285 2011-05-17 06:55:23