2016-07-04 142 views
-2

您好我有一個MS訪問查詢它在我運行的.mdb文件中工作,並返回一些數據,但當我使用telerik報告時,我把我的查詢,但它給我所有的時間這個錯誤:c#telerik報告訪問查詢錯誤

The provider could not determine the String value. For example , the line had been created, the default value for the String column was not available and the consumer did not set a new String value .

這裏的查詢:

SELECT tbCie.ID AS IDCompagnie, 
tbCie.Nom AS NomEtablissement, 
tbCie.Telephone AS TelephoneEtablissement, 
tbQVCSection.Description AS NomQuestionnaire, 
"(" & tbPatient.Id & ") " & tbPatient.Prenom + " " & tbPatient.Nom AS NomPatient, 
tbLogos.Image, 
IIF(IIF(IsNull(tbCie.Adresse1), "", tbCie.Adresse1) <> "", tbCie.Adresse1 & Chr(10), "") & IIF(IIF(IsNull(tbCie.Adresse2), "", tbCie.Adresse2) <> "", tbCie.Adresse2 & Chr(10), "") & 
IIF(IIF(IsNull(tbCie.Province), "", tbCie.Province) <> "", IIF(IIF(IsNull(tbCie.Ville), "", tbCie.Ville) <> "", tbCie.Ville & ", " & tbCie.Province & Chr(10), tbCie.Province & Chr(10)), IIF(IIF(IsNull(tbCie.Ville), "", tbCie.Ville) <> "", tbCie.Ville + Chr(10), "")) & 
IIF(IIF(IsNull(tbCie.CodePostal), "", tbCie.CodePostal) <> "", tbCie.CodePostal & Chr(10), "") & 
IIF(IIF(IsNull(tbCie.Telephone), "", tbCie.Telephone) <> "", tbCie.Telephone, "") AS AdresseComplete, 
IIF(IsNull(tbPatient_QVCEntete.DateModification), DateValue(CStr(tbPatient_QVCEntete.DateCreation)) & " " & TimeValue(CStr(tbPatient_QVCEntete.DateCreation)), DateValue(CStr(tbPatient_QVCEntete.DateModification)) & " " & TimeValue(CStr(tbPatient_QVCEntete.DateModification))) As DateEnregistrement, 
DateValue(CStr(tbPatient.DateNaissance)) & " " & TimeValue(CStr(tbPatient.DateNaissance)) AS DateNaissance, 
DateDiff("yyyy", tbPatient.DateNaissance, Date()) AS Age, 
IIF(IsNull(tbPatient.Poids), "", tbPatient.Poids & " KG") As Poids, 
IIF(IsNull(tbPatient.Taille), "", tbPatient.Taille & " CM") As Taille, 
tbPatient.NoAssuranceMaladie, 
tbPatient.DateExpiration, 
IIF(tbPatient.SexeMasculin = -1, "Masculin", IIF(tbPatient.SexeFeminin = -1, "Féminin", "")) As Sexe, 
IIF(IIF(IsNull(tbPatient.NomEtablissement), "", tbPatient.NomEtablissement) <> "", tbPatient.NomEtablissement & Chr(10), "") & 
IIF(IIF(IsNull(tbPatient.Adresse1), "", tbPatient.Adresse1) <> "", IIF(IIF(IsNull(tbPatient.NoApp), "", tbPatient.NoApp) <> "", tbPatient.NoApp & "-" & 
    tbPatient.Adresse1, tbPatient.Adresse1) & Chr(10), "") & 
IIF(IIF(IsNull(tbPatient.Adresse2), "", tbPatient.Adresse2) <> "", tbPatient.Adresse2 & Chr(10), "") & 
IIF(IIF(IsNull(tbPatient.Province), "", tbPatient.Province) <> "", IIF(IIF(IsNull(tbVilleIso.Ville), "", tbVilleIso.Ville) <> "", tbVilleIso.Ville & ", " & 
     tbProvinceIso.Province & Chr(10), tbProvinceIso.Province & Chr(10)), 
    IIF(IIF(IsNull(tbCie.Ville), "", tbCie.Ville) <> "", tbVilleIso.Ville & Chr(10), "")) & 
IIF(IIF(IsNull(tbPatient.CodePostal), "", tbPatient.CodePostal) <> "", tbPatient.CodePostal & Chr(10), "") AS AdressePatientComplete, 


IIF(
    IIF(
     IsNull(tbPatient.TelephoneDomicile), "", tbPatient.TelephoneDomicile) <> "", 
    "Téléphone Domicile: " & tbPatient.TelephoneDomicile, "" & 


    IIF(
     IIF(
      IsNull(tbPatient.NoPosteTelephoneMaison), "0", tbPatient.NoPosteTelephoneMaison) <> "0", 
     " poste: " & tbPatient.NoPosteTelephoneMaison, 
     "" 
    ) 
) & Chr(10) & 
IIF(
    IIF(
     IsNull(tbPatient.TelephonePortable), "", tbPatient.TelephonePortable) <> "", 
    "Téléphone Portable: " & tbPatient.TelephonePortable & Chr(10), 
    "" 
) As TelephoneComplet,IIF(ISNULL(tbPatient_QVCDestination.Ville), IIF(IsNull(tbPatient_QVCDestination.Pays), "", tbPatient_QVCDestination.Pays), IIF(IsNull(tbPatient_QVCDestination.Pays), tbPatient_QVCDestination.Ville, tbPatient_QVCDestination.Ville & ", " & tbPatient_QVCDestination.Pays)) As Destination, 
IIF(ISNULL(Duree), "", Duree) As DureeVoyage, 
IIF(ISNULL(sDateDepart), "", sDateDepart) As DateDepart FROM(((((tbCie LEFT JOIN tbLogos ON tbCie.IDLogo = tbLogos.IDLogo) INNER JOIN((tbPatient INNER JOIN tbPatient_QVCEntete ON tbPatient.ID = tbPatient_QVCEntete.IDPatient) INNER JOIN tbQVCSection ON tbPatient_QVCEntete.IDSection = tbQVCSection.ID) 
    ON tbCie.ID = tbPatient_QVCEntete.IDCompagnie) LEFT JOIN tbPatient_QVCDestination ON tbPatient_QVCEntete.ID = tbPatient_QVCDestination.IDQVCEntete) LEFT JOIN tbPaysISO ON(tbPatient.PaysISOChar3 = tbPaysISO.PaysISOChar3 AND tbPaysISO.Langue = "3084")) LEFT JOIN tbProvinceISO ON(tbPatient.ProvinceISOChar = tbProvinceISO.ProvinceISOChar AND tbProvinceISO.Langue = "3084")) LEFT JOIN tbVilleISO ON(tbPatient.IdVille = tbVilleISO.ID AND tbVilleISO.Langue = "3084") WHERE (tbPatient_QVCEntete.ID = 37) 
+0

什麼是您的連接字符串? – Kramb

+0

我發現了我的問題。這是因爲一些列正在返回#error但訪問仍然返回行,但在我的報告中,它給了我沒有說明的消息... 感謝您的關注無論如何:) – alexandre

+0

嘿,不是問題。很高興你明白了! – Kramb

回答

0

我發現我的問題。這是因爲一些列正在返回#error,但訪問仍然返回行,但在我的報告中,它給了我沒有說明的消息...感謝您的關注無論如何:)