An access request returns empty fields depending on how the table is bound.

I have an MDB Access that I use for reporting related to SQL Server 2005 table views. I built a query that retrieves information from a PO table and classifies the position based on information from another table. I am relatively confident that the request was fine until about a month ago, when we switched from compatibility mode from 80 to 90 to the server, as required by our main application (which creates data). I can’t say this with 100% certainty, but this is the only significant change in the last 90 days. We noticed that unexpectedly the data did not appear in the request, as a result of which the reports looked strange.

This is a copy of the failed request:

SELECT dbo_porel.jobnum, dbo_joboper.opcode, dbo_porel.jobseqtype,
    dbo_opmaster.shortchar01, 
    dbo_porel.ponum, dbo_porel.poline, dbo_podetail.unitcost

FROM ((dbo_porel 
LEFT JOIN dbo_joboper ON (dbo_porel.assemblyseq = dbo_joboper.assemblyseq) 
    AND (dbo_porel.jobseq = dbo_joboper.oprseq) 
    AND (dbo_porel.jobnum = dbo_joboper.jobnum)) 
LEFT JOIN dbo_opmaster ON dbo_joboper.opcode = dbo_opmaster.opcode) 
LEFT JOIN dbo_podetail ON (dbo_porel.poline = dbo_podetail.poline) 
    AND (dbo_porel.ponum = dbo_podetail.ponum)

WHERE (dbo_porel.jobnum="367000003")

It returns the following:

jobnum    opcode  jobseqtype  shortchar01  ponum  poline  unitcost
367000003            S                     6624       2      15


shortchar01. dbo_podetail, ( , , unitcost). , , , , .

, :

SELECT qryTest.*, dbo_podetail.unitcost

FROM (

    SELECT dbo_porel.jobnum, dbo_joboper.opcode, dbo_porel.jobseqtype,
        dbo_opmaster.shortchar01, dbo_porel.ponum, dbo_porel.poline

    FROM (dbo_porel 
    LEFT JOIN dbo_joboper ON (dbo_porel.jobnum=dbo_joboper.jobnum) 
        AND (dbo_porel.jobseq=dbo_joboper.oprseq) 
        AND (dbo_porel.assemblyseq=dbo_joboper.assemblyseq)) 
    LEFT JOIN dbo_opmaster ON dbo_joboper.opcode=dbo_opmaster.opcode

    WHERE (dbo_porel.jobnum="367000003")

) As qryTest 
LEFT JOIN dbo_podetail ON (qryTest.poline = dbo_podetail.poline) 
    AND (qryTest.ponum = dbo_podetail.ponum)


, , . , , ( , ).

- - ?

+3
2

/ Access.
, Jet, , /.

, , .

+1

Access . .

FROM 
    dbo_porel 
LEFT JOIN 
    dbo_joboper ON (dbo_porel.assemblyseq = dbo_joboper.assemblyseq) 
        AND (dbo_porel.jobseq = dbo_joboper.oprseq) 
        AND (dbo_porel.jobnum = dbo_joboper.jobnum)
LEFT JOIN 
    dbo_opmaster ON (dbo_joboper.opcode = dbo_opmaster.opcode)
LEFT JOIN 
    dbo_podetail ON (dbo_porel.poline = dbo_podetail.poline) 
        AND (dbo_porel.ponum = dbo_podetail.ponum)

, - ,

0

Source: https://habr.com/ru/post/1704285/


All Articles