Esecuzione query

mercoledì 28 febbraio 2018 - 00.52
Tag Elenco Tags  C#  |  .NET 4.0  |  Windows 7  |  Visual Studio 2010  |  Access (.mdb)

iif Profilo | Expert

Ciao a tutti,
è una settimana che sbatto la testa con un problema di esecuzione di una query dentro un db access 2000.
Se la query la lancio da dentro access funziona, se invece tento di eseguirla dal codice di una form scritta con c# non tornano i record.
Vi posto la query, magari è un problema di sintassi:
SELECT TDocRighe.IDDoc, 380 AS Espr141, "07451221001" AS ID_EDI, "ZZ" AS Espr142, Right(CStr([TDocTestate].[DataDoc]),4) & Mid(CStr([TDocTestate].[DataDoc]),4,2) & Left(CStr([TDocTestate].[DataDoc]),2) AS DocData, TDocTestate.NumDoc AS DocNum, "02D" AS tipo_rec, 355 AS Espr140, 92 AS Espr2, TAnagraficaDest.Nome, TAnagraficaDest.Indirizzo, TAnagraficaDest.Citta, TAnagraficaDest.Prov, TAnagraficaDest.Cap, DDT_FATTURATI.NUMDDT, DDT_FATTURATI.DATADDT, "" AS Espr3, "" AS Espr62, "" AS eSPR63, "" AS Espr64, 100 AS Espr4, TDocRighe.CodArticoloForn, "SA" AS Espr5, "" AS Espr6, "" AS Espr7, "" AS Espr8, "" AS Espr9, [TArticoli].[Desc] & " " & [TDocRighe].[Lotto] AS Espr111, "" AS Espr10, "" AS Espr11, "L01" AS Espr12, "+" AS Espr13, TDocRighe.Qta AS c1, "" AS Espr14, "" AS Espr15, "" AS Espr16, "" AS Espr17, "+" AS Espr18, TDocRighe.PrezzoNetto, "AAA" AS Espr19, "" AS Espr20, "" AS Espr21, "" AS Espr22, "PCE" AS Espr23, TDocRighe.Qta AS c2, "+" AS Espr112, TDocRighe.ImportoNettoRiga, "H" AS Espr25, "+" AS Espr24, TDocRighe.CodIva, "+" AS Espr26, [ImportoIvatoRiga]-[IMPORTONETTORIGA] AS Espr27, "DESCR_COD_IVA" AS Espr28, "" AS Espr30, "" AS Espr31, "" AS Espr32, "" AS Espr33, "" AS Espr34, "" AS Espr35, "" AS Espr36, "" AS Espr37, "" AS Espr38, "" AS Espr39, "" AS Espr40, "" AS Espr41, "" AS Espr42, "" AS Espr43, "" AS Espr44, "" AS Espr45, "" AS Espr46, "" AS Espr47, "" AS Espr48, "" AS Espr49, "" AS Espr50, "" AS Espr51, "" AS Espr52, "" AS Espr53, "" AS Espr54, "" AS Espr55, "" AS Espr56, "" AS Espr57, "" AS Espr58, "" AS Espr59, "" AS Espr60, "" AS Espr61, "" AS Espr65, "" AS Espr66, "" AS Espr67, "" AS Espr68, "" AS Espr69, "" AS Espr70, "" AS Espr71, "" AS Espr72, "" AS Espr73, "" AS Espr74, "" AS Espr75, "" AS Espr76, "" AS Espr77, "" AS Espr78, "" AS Espr79, "" AS Espr80, "" AS Espr81, "" AS Espr82, "" AS Espr83, "" AS Espr84, "" AS Espr85, "" AS Espr86, "" AS Espr87, "" AS Espr88, "" AS Espr89, "" AS Espr29, "" AS Espr90, "" AS Espr91, "" AS Espr92, "" AS Espr93, TDocRighe.Qta AS c3, "" AS Espr94, "" AS Espr95, "" AS Espr96, "" AS Espr97, "" AS Espr98, "" AS Espr99, "" AS Espr100, "" AS Espr101, "" AS Espr102, "" AS Espr103, "" AS Espr104, "" AS Espr105, "" AS Espr106, "" AS Espr107, "" AS Espr108, "" AS Espr109, "" AS Espr110, TDocRighe.Qta
FROM (DDT INNER JOIN (DDT_FATTURATI INNER JOIN (TDocTestate INNER JOIN (TDocRighe LEFT JOIN TArticoli ON TDocRighe.CodArticolo = TArticoli.CodArticolo) ON TDocTestate.IDDoc = TDocRighe.IDDoc) ON DDT_FATTURATI.IDDoc = TDocTestate.IDDoc) ON (DDT.DATADDT = DDT_FATTURATI.DATADDT) AND (DDT.NumDoc = DDT_FATTURATI.NUMDDT)) INNER JOIN TAnagraficaDest ON DDT.CodDest = TAnagraficaDest.CodDest
WHERE (((TDocTestate.TipoDoc)="I"));

Grazie.
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2018
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5