DataMiner
07-14-2005, 12:55 PM
I get the error message "could not use xxx.mdb;file already in use" when trying to run some append queries, but NOT when trying to run some other append queries which use the same linked table.
For example, this query gives the error message:
INSERT INTO DataIntegrityErrors ( Product, Problem, ProductItemNo, ChartPoint, MinDate, MaxDate, Qty, FinalsCell, MfgGroup, Source, ProductNounProblem )
SELECT [Yield Data All for Tool].[Product Name], "Finals Yields not in FinalsProductInfo" AS Expr1, ProductCodes.Item, [Yield Data All for Tool].ChartPoint, Min([Yield Data All for Tool].[Test Date]) AS [MinOfTest Date], Max([Yield Data All for Tool].[Test Date]) AS [MaxOfTest Date], Sum([Yield Data All for Tool].QtyTested) AS SumOfQtyTested, [Yield Data All for Tool].Cell, [Yield Data All for Tool].[MFG Group], [Yield Data All for Tool].Source, [yield data all for tool].[product name] & "Finals Yields not in FinalsProductInfo" AS Expr2
FROM (([Yield Data All for Tool] LEFT JOIN FinalsProductInfo ON [Yield Data All for Tool].[Product Name]=FinalsProductInfo.Product) LEFT JOIN ProductCodes ON [Yield Data All for Tool].[Product Name]=ProductCodes.[Product Name]) LEFT JOIN DataIntegrityErrors ON [Yield Data All for Tool].[Product Name]=DataIntegrityErrors.Product
WHERE (((FinalsProductInfo.Product) Is Null) AND (([Yield Data All for Tool].[Test Date])>#5/28/2004#) AND ((DataIntegrityErrors.Ignore)=False Or (DataIntegrityErrors.Ignore) Is Null))
GROUP BY [Yield Data All for Tool].[Product Name], "Finals Yields not in FinalsProductInfo", ProductCodes.Item, [Yield Data All for Tool].ChartPoint, [Yield Data All for Tool].Cell, [Yield Data All for Tool].[MFG Group], [Yield Data All for Tool].Source, [yield data all for tool].[product name] & "Finals Yields not in FinalsProductInfo", [Yield Data All for Tool].Company, [Yield Data All for Tool].Model
HAVING ((([Yield Data All for Tool].[Product Name])<>"default item") AND ((Max([Yield Data All for Tool].[Test Date])) Between Date()-30 And Date()) AND (([Yield Data All for Tool].[MFG Group]) In ("fnet mfg","fpm mfg","ind mfg","ptool mfg","biomed mfg")))
ORDER BY [Yield Data All for Tool].[Product Name], ProductCodes.Item, [Yield Data All for Tool].ChartPoint;
And this query does not:
INSERT INTO PD1a ( [Test Date], Division, ModelGroup, [Product Name], SumOfQtyTested, SumOfQtyFailed, ChartPoint, FinalsCell )
SELECT [Yield Data All for Tool].[Test Date], FinalsProductInfo.Customer, FinalsProductInfo.ModelGroupDefault, IIf([product name]<>"optiview",[product name],IIf([chartpoint] Like "bull*","OptiviewBHAT",IIf([chartpoint] Like "rocky*","OptiviewRAT",[product name]))) AS Expr1, Sum([Yield Data All for Tool].QtyTested) AS SumOfQtyTested, Sum([Yield Data All for Tool].QtyFailed) AS SumOfQtyFailed, nz([ChartPoint],"unknown") AS Expr6, First([Yield Data All for Tool].Cell) AS FirstOfCell
FROM FinalsProductInfo INNER JOIN [Yield Data All for Tool] ON FinalsProductInfo.Product = [Yield Data All for Tool].[Product Name]
GROUP BY [Yield Data All for Tool].[Test Date], FinalsProductInfo.Customer, FinalsProductInfo.ModelGroupDefault, IIf([product name]<>"optiview",[product name],IIf([chartpoint] Like "bull*","OptiviewBHAT",IIf([chartpoint] Like "rocky*","OptiviewRAT",[product name]))), nz([ChartPoint],"unknown")
HAVING ((([Yield Data All for Tool].[Test Date]) Between Date()-180 And Date()) AND ((First([Yield Data All for Tool].[MFG Group])) In ("fnet mfg","fpm mfg","ind mfg","ptool mfg","biomed mfg")));
They both use the linked table [Yield Data All for Tool], and the error message I'm getting indicates that the mdb file containing this table is the one that's "already in use".
So why does one work, and one doesn't???
The one that doesn't work, I can't even view the QBE grid, I can only view the SQL.
Any ideas???
For example, this query gives the error message:
INSERT INTO DataIntegrityErrors ( Product, Problem, ProductItemNo, ChartPoint, MinDate, MaxDate, Qty, FinalsCell, MfgGroup, Source, ProductNounProblem )
SELECT [Yield Data All for Tool].[Product Name], "Finals Yields not in FinalsProductInfo" AS Expr1, ProductCodes.Item, [Yield Data All for Tool].ChartPoint, Min([Yield Data All for Tool].[Test Date]) AS [MinOfTest Date], Max([Yield Data All for Tool].[Test Date]) AS [MaxOfTest Date], Sum([Yield Data All for Tool].QtyTested) AS SumOfQtyTested, [Yield Data All for Tool].Cell, [Yield Data All for Tool].[MFG Group], [Yield Data All for Tool].Source, [yield data all for tool].[product name] & "Finals Yields not in FinalsProductInfo" AS Expr2
FROM (([Yield Data All for Tool] LEFT JOIN FinalsProductInfo ON [Yield Data All for Tool].[Product Name]=FinalsProductInfo.Product) LEFT JOIN ProductCodes ON [Yield Data All for Tool].[Product Name]=ProductCodes.[Product Name]) LEFT JOIN DataIntegrityErrors ON [Yield Data All for Tool].[Product Name]=DataIntegrityErrors.Product
WHERE (((FinalsProductInfo.Product) Is Null) AND (([Yield Data All for Tool].[Test Date])>#5/28/2004#) AND ((DataIntegrityErrors.Ignore)=False Or (DataIntegrityErrors.Ignore) Is Null))
GROUP BY [Yield Data All for Tool].[Product Name], "Finals Yields not in FinalsProductInfo", ProductCodes.Item, [Yield Data All for Tool].ChartPoint, [Yield Data All for Tool].Cell, [Yield Data All for Tool].[MFG Group], [Yield Data All for Tool].Source, [yield data all for tool].[product name] & "Finals Yields not in FinalsProductInfo", [Yield Data All for Tool].Company, [Yield Data All for Tool].Model
HAVING ((([Yield Data All for Tool].[Product Name])<>"default item") AND ((Max([Yield Data All for Tool].[Test Date])) Between Date()-30 And Date()) AND (([Yield Data All for Tool].[MFG Group]) In ("fnet mfg","fpm mfg","ind mfg","ptool mfg","biomed mfg")))
ORDER BY [Yield Data All for Tool].[Product Name], ProductCodes.Item, [Yield Data All for Tool].ChartPoint;
And this query does not:
INSERT INTO PD1a ( [Test Date], Division, ModelGroup, [Product Name], SumOfQtyTested, SumOfQtyFailed, ChartPoint, FinalsCell )
SELECT [Yield Data All for Tool].[Test Date], FinalsProductInfo.Customer, FinalsProductInfo.ModelGroupDefault, IIf([product name]<>"optiview",[product name],IIf([chartpoint] Like "bull*","OptiviewBHAT",IIf([chartpoint] Like "rocky*","OptiviewRAT",[product name]))) AS Expr1, Sum([Yield Data All for Tool].QtyTested) AS SumOfQtyTested, Sum([Yield Data All for Tool].QtyFailed) AS SumOfQtyFailed, nz([ChartPoint],"unknown") AS Expr6, First([Yield Data All for Tool].Cell) AS FirstOfCell
FROM FinalsProductInfo INNER JOIN [Yield Data All for Tool] ON FinalsProductInfo.Product = [Yield Data All for Tool].[Product Name]
GROUP BY [Yield Data All for Tool].[Test Date], FinalsProductInfo.Customer, FinalsProductInfo.ModelGroupDefault, IIf([product name]<>"optiview",[product name],IIf([chartpoint] Like "bull*","OptiviewBHAT",IIf([chartpoint] Like "rocky*","OptiviewRAT",[product name]))), nz([ChartPoint],"unknown")
HAVING ((([Yield Data All for Tool].[Test Date]) Between Date()-180 And Date()) AND ((First([Yield Data All for Tool].[MFG Group])) In ("fnet mfg","fpm mfg","ind mfg","ptool mfg","biomed mfg")));
They both use the linked table [Yield Data All for Tool], and the error message I'm getting indicates that the mdb file containing this table is the one that's "already in use".
So why does one work, and one doesn't???
The one that doesn't work, I can't even view the QBE grid, I can only view the SQL.
Any ideas???