Ssssiiigggghhhh.... :banghead:
Tried and true shared code all of a sudden fails silently on one query. I download records from the SQL BE DB into FE temp tables with the following shared code:
Example of DAO.QueryDef objects downloading records from a SQL BE DB via Pass-Through query and populating a FE temp table with them
http://www.access-programmers.co.uk/forums/showthread.php?p=1119605&posted=1#post1119605
I have commented out the cleanup of the DAO.QueryDef objects as the new record was not getting inserted into the FE temp table, so thought to step through and see where the error might be.
Executing (via GUI) the Pass-Through query selects the correct newly added record.
Executing the outer wrapper DAO.QueryDef pops the warning message that one record will be inserted, plop plop fizz fizz the desired record ends up in the FE temp table.
So, I shall paste the contents of the two DAO.QueryDef objects... perhaps I have a typo that causes execution via VBA automation to fail.
vbaclsObjAOEStationTbl_RefreshLocalTmpTbl_Update_PT has the following query:
vbaclsObjAOEStationTbl_RefreshLocalTmpTbl_Update has the following query:
rrrrrr????? Paste again...
vbaclsObjAOEStationTbl_RefreshLocalTmpTbl_Update_PT
Oh... that does beat all... the forum software is showing a mysterious space between the P and the T in the Pass-Through DAO.QueryDef name! I simply append on a static:
And pasting the source code there is no mysterious space between P and T.
I have already run my Decompile / Compact / Compile procedure and the problem yet persists.
Any suggestions where the hidden character might be coming from? TIA!
P.S. And the same table name appears in the outer DAO.QueryDef wrapper selecting/inserting. I marked that in blue.
Tried and true shared code all of a sudden fails silently on one query. I download records from the SQL BE DB into FE temp tables with the following shared code:
Example of DAO.QueryDef objects downloading records from a SQL BE DB via Pass-Through query and populating a FE temp table with them
http://www.access-programmers.co.uk/forums/showthread.php?p=1119605&posted=1#post1119605
I have commented out the cleanup of the DAO.QueryDef objects as the new record was not getting inserted into the FE temp table, so thought to step through and see where the error might be.
Executing (via GUI) the Pass-Through query selects the correct newly added record.
Executing the outer wrapper DAO.QueryDef pops the warning message that one record will be inserted, plop plop fizz fizz the desired record ends up in the FE temp table.
So, I shall paste the contents of the two DAO.QueryDef objects... perhaps I have a typo that causes execution via VBA automation to fail.
vbaclsObjAOEStationTbl_RefreshLocalTmpTbl_Update_PT has the following query:
Code:
SET NOCOUNT ON; DECLARE @aoesid AS int; SET @aoesid = 9; EXEC dbo.clsObjAOEStationTbl_RefreshLocalTmpTbl_1ea @aoesid;
Code:
INSERT INTO tmptblqry_aoestation ( id, authid, authusername, logtimestamp, cmplstatusid, cmplstatustitle, stationname, ergobriefflg, ergobestflg, mnfm, loto, notes )
SELECT t.id, t.authid, t.authusername, t.logtimestamp, t.cmplstatusid, t.cmplstatustitle, t.stationname, t.ergobriefflg, t.ergobestflg, t.mnfm, t.loto, t.notes
FROM [COLOR=Blue][B]vbaclsObjAOEStationTbl_RefreshLocalTmpTbl_Update_PT[/B][/COLOR] AS t;
rrrrrr????? Paste again...
vbaclsObjAOEStationTbl_RefreshLocalTmpTbl_Update_PT
Oh... that does beat all... the forum software is showing a mysterious space between the P and the T in the Pass-Through DAO.QueryDef name! I simply append on a static:
Code:
'Define the name for the BE query
strQryNameBE = "vba" & strQueryAPIName & [B][COLOR=Red]"_PT"[/COLOR][/B]
I have already run my Decompile / Compact / Compile procedure and the problem yet persists.
Any suggestions where the hidden character might be coming from? TIA!
P.S. And the same table name appears in the outer DAO.QueryDef wrapper selecting/inserting. I marked that in blue.
Last edited: