09-07-2005 03:10 PM
09-07-2005 04:44 PM
Copy the query out of the access file and then execute it using the toolkit. Can you read the query from Access using ActiveX?
Mike...
09-07-2005 04:57 PM
09-07-2005 05:04 PM
What is the text of the query you are trying to execute?
Mike...
09-08-2005 08:45 AM
Here is the query I am trying to execute.
SELECT ToolFamilies.ToolFamilyID, AssemblyMeasurements.Diameter, AssemblyMeasurements.Type, AssemblyMeasurements.GageLength, AssemblyMeasurements.NominalLength, AssemblyMeasurements.MinBreak, AssemblyMeasurements.NominalCountersink, ToolFamilies.Name AS Description
FROM (ToolTypes INNER JOIN ToolFamilies ON ToolTypes.ToolTypeID = ToolFamilies.ToolTypeID) INNER JOIN (AssemblyTypes INNER JOIN (Tools INNER JOIN ((Assemblies INNER JOIN AssemblyMeasurements ON (Assemblies.AssemblyID = AssemblyMeasurements.AssemblyID) AND (Assemblies.AssemblyID = AssemblyMeasurements.AssemblyID) AND (Assemblies.AssemblyID = AssemblyMeasurements.AssemblyID)) INNER JOIN (qrySelectLastAssemblyForTool INNER JOIN ToolAssemblyAssocs ON qrySelectLastAssemblyForTool.AssemblyID = ToolAssemblyAssocs.AssemblyID) ON (Assemblies.AssemblyID = ToolAssemblyAssocs.AssemblyID) AND (Assemblies.AssemblyID = ToolAssemblyAssocs.AssemblyID) AND (Assemblies.AssemblyID = ToolAssemblyAssocs.AssemblyID)) ON (Tools.ToolID = ToolAssemblyAssocs.ToolID) AND (Tools.ToolID = ToolAssemblyAssocs.ToolID) AND (Tools.ToolID = ToolAssemblyAssocs.ToolID)) ON (AssemblyTypes.AssemblyTypeID = Assemblies.AssemblyTypeID) AND (AssemblyTypes.AssemblyTypeID = Assemblies.AssemblyTypeID)) ON ToolFamilies.ToolFamilyID = Tools.ToolFamilyID
WHERE (((ToolTypes.Name)="Drill"));
09-08-2005 09:18 AM
In case you have any doubts left as to why it's not a good idea to let Access write SQL for you.... WOW!
Given this syntactical mishmash my guess at this point is that there's something in the statement that the drivers don't like--especially if you are using the ODBC interface.
Step 1: Can you talk to the database if you send it a real simple query like:
SELECT * from ToolTypes
That should dump the entire contents of the ToolTypes table. If this works there's something screwy in the syntax that is causing the problem. I could help you rewrite the query but would need to know the table structures that are in the database. If it doesn't work there is something wlse going on (access permissions?).
Mike...
09-08-2005 05:26 PM
09-08-2005 07:08 PM
The Practical SQL Handbook, 4th Edition, J.S. Bowman, S.L. Emerson, M. Darnovsky,
Addison-Wesley Developer’s Press, 2001, ISBN: 0-201-70309-2
(The 3rd edition is still available online through Amazon, and is also very good…)
Mike...