I’ve modified the QuotedNameMA function so it doesn’t test for spaces. I’ve confirmed it’s written to the same Package folder; but it just is not getting called. I’ve removed all previous Toad version so can’t be called from an earlier version.
I did add “XXX[” in the function return so I can track where QuotedNameMA was called, but nothing showed up. This suggests there’s something odd with where Toad is calling the package from?
Here’s the sample of created code.
'=== Create query qry007_WaterTanks ======
Set cmd = New ADODB.Command
cmd.CommandText = "SELECT InspectionDetails.FarmerName, InspectionDetails.PropertyName, WaterTanks.PhotoID, WaterTanks.Number, WaterTanks.WaterTanks, WaterTanks.Position, WaterTanks.[Diameter (m)], WaterTanks.[Height (m)], WaterTanks.Calc_volume, WaterTanks.[Volume (L)], WaterTanks.NumberofItems, WaterTanks.YearBuilt," _
+ " WaterTanks.Condition, WaterTanks.comments " _
+ "FROM InspectionDetails INNER JOIN WaterTanks ON InspectionDetails.InspectionRID = WaterTanks.InspectionRID; "
cat.Views.Append "qry007_WaterTanks", cmd
When I bracket the “WaterTanks.Position” text the Append also works fine.
When I remove the “WaterTanks.Position” text the ADO Append works fine (“Position” is a reserved word)
Since I can’t get the bracketing to work in QuotedNameMA function, perhaps it could be set to use brackets for all objects - which of course your suggested changes intends?
Really need to fix this for future models.