R
rmcompute
From database PCExtract.mdb, I set up code to use SQL to extract data from
another database, PCBranch.mdb. The extract works fine but when I run a
query which worked before the extract, I get the message: Could Not Delete
From Specified Tables. Is it possible the table becomes locked or there is
some issue with permissions ?
Code:
strPath = \\18DBS201\refresh\Service\
strDatabase = "PerformanceChallengeBranch.mdb"
strFromTable = tblTeamNames
strToTable = tblTeamNames_50
strSql = "SELECT " & strFromTable & ".* INTO " & strToTable & " FROM " &
strFromTable & " IN '" & strPath & strDatabase & "';"
DoCmd.RunSQL strSql
Query Code:
DELETE tblTeamNames.*, tblTeamNames_50.Branch, tblTeamNames.Branch
FROM tblTeamNames LEFT JOIN tblTeamNames_50 ON (tblTeamNames.TeamName =
tblTeamNames_50.TeamName) AND (tblTeamNames.Branch = tblTeamNames_50.Branch)
WHERE (((tblTeamNames_50.Branch) Is Null) AND ((tblTeamNames.Branch)=50));
another database, PCBranch.mdb. The extract works fine but when I run a
query which worked before the extract, I get the message: Could Not Delete
From Specified Tables. Is it possible the table becomes locked or there is
some issue with permissions ?
Code:
strPath = \\18DBS201\refresh\Service\
strDatabase = "PerformanceChallengeBranch.mdb"
strFromTable = tblTeamNames
strToTable = tblTeamNames_50
strSql = "SELECT " & strFromTable & ".* INTO " & strToTable & " FROM " &
strFromTable & " IN '" & strPath & strDatabase & "';"
DoCmd.RunSQL strSql
Query Code:
DELETE tblTeamNames.*, tblTeamNames_50.Branch, tblTeamNames.Branch
FROM tblTeamNames LEFT JOIN tblTeamNames_50 ON (tblTeamNames.TeamName =
tblTeamNames_50.TeamName) AND (tblTeamNames.Branch = tblTeamNames_50.Branch)
WHERE (((tblTeamNames_50.Branch) Is Null) AND ((tblTeamNames.Branch)=50));