Knowledgebase

Search:     Advanced search

ODBC Call Failed Error #1032

Article ID: 346  |  Last updated: 30 Dec, 2014

Note: The following information only applies to TestTrack 2011.1.3 and earlier.

Problem

When you process a query using the TestTrack ODBC driver, you receive the following error message:

ODBC - call failed.
[Seapine Software][TestTrack ODBC Driver]T (#1032)

Cause

A main query is calling a sub query that contains an inner join.

Solution

Create temp tables from the sub queries and call the temp tables from the main query. See the following example for more information, including a workaround solution.

Example

You want to retrieve the number of closed defects that were both Closed and Verified Passed, and the number of new defects opened, in the past 7 days.

Your original queries might look something like the following:

<==Main Query ==
SELECT "New Since " & Format(DateAdd("d",-7,Now()),"dd-mm-yyyy") AS [DESCRIPTOR],
Count( DEFECTS.DEFECTNUM) AS CountOfDEFECTNUM FROM (REPORTBY LEFT JOIN USERS ON REPORTBY.IDFOUNDBY = USERS.IDRECORD) RIGHT JOIN DEFECTS ON REPORTBY.IDDEFREC = DEFECTS.IDRECORD WHERE (((REPORTBY.DATEFOUND)>=Format(DateAdd("d",-7,Now()),"dd-mm-yyyy"))); UNION SELECT "Closed Since " & Format(DateAdd("d",-7,Now()),"dd-mm-yyyy") AS [DESCRIPTOR], Count( DEFECTS.DEFECTNUM) AS CountOfDEFECTNUM FROM qryClosed INNER JOIN (USERS RIGHT JOIN (DEFECTS LEFT JOIN FLDDISPO ON DEFECTS.IDDISPOSIT = FLDDISPO.IDRECORD) ON USERS.IDRECORD = DEFECTS.IDMODIFYBY) ON qryClosed.DEFECTNUM = DEFECTS.DEFECTNUM WHERE (((qryClosed.DateEvent)>=Format(DateAdd("d",-7,Now()),"dd-mm-yyyy")));


== Sub Query qryClosed ==
SELECT DEFECTS.DEFECTNUM, CLOSED.DATEEVENT as DateEvent FROM CLOSED INNER JOIN DEFECTS ON CLOSED.IDDEFREC = DEFECTS.IDRECORD UNION SELECT DEFECTS.DEFECTNUM, VERIFY.DATEEVENT as DateEvent FROM DEFECTS INNER JOIN VERIFY ON DEFECTS.IDRECORD = VERIFY.IDDEFREC where Verify.PASSVERIFY="Y";

After running this query, you receive an error message because the Sub Query qryClosed has an inner join in it.

The following workaround needs to be made for this query to run:

== qryMkTblClosedPassed ==
SELECT DEFECTS.DEFECTNUM, CLOSED.DATEEVENT INTO [ClosedPassed] FROM CLOSED INNER JOIN DEFECTS ON CLOSED.IDDEFREC = DEFECTS.IDRECORD WHERE (((DEFECTS.STATUS)=5));

==qryApTblClosedPassed ==
INSERT INTO [ClosedPassed] ( DEFECTNUM, DATEEVENT ) SELECT DEFECTS.DEFECTNUM, VERIFY.DATEEVENT FROM VERIFY INNER JOIN DEFECTS ON VERIFY.IDDEFREC = DEFECTS.IDRECORD WHERE (((DEFECTS.STATUS)=4));

 == qryMain ==
SELECT "New Since " & Format(DateAdd("d",-7,Now()),"dd-mm-yyyy") AS [DESCRIPTOR], Count( DEFECTS.DEFECTNUM) AS CountOfDEFECTNUM FROM (REPORTBY LEFT JOIN USERS ON REPORTBY.IDFOUNDBY = USERS.IDRECORD) RIGHT JOIN DEFECTS ON REPORTBY.IDDEFREC = DEFECTS.IDRECORD WHERE (((REPORTBY.DATEFOUND)>=Format(DateAdd("d",-7,Now()),"dd-mm-yyyy"))); UNION SELECT "Closed Since " & Format(DateAdd("d",-7,Now()),"dd-mm-yyyy") AS [DESCRIPTOR], Count( DEFECTS.DEFECTNUM) AS CountOfDEFECTNUM FROM ClosedPassed INNER JOIN (USERS RIGHT JOIN (DEFECTS LEFT JOIN FLDDISPO ON DEFECTS.IDDISPOSIT = FLDDISPO.IDRECORD) ON USERS.IDRECORD = DEFECTS.IDMODIFYBY) ON ClosedPassed.DEFECTNUM = DEFECTS.DEFECTNUM WHERE (((ClosedPassed.DateEvent)>=Format(DateAdd("d",-7,Now()),"mm/dd/yy")));


Note: Each time you want to run these queries, you must run the ryMkTblClosedPassed and qryApTblClosedPassed queries before you run qryMain.

Article ID: 346  |   Last updated: 30 Dec, 2014
Tags
ODBC call failed 1032

Prev   Next
Changing Application Fonts on Unix Platforms     Using Microsoft Access to Query TestTrack Projects