After Import: Could Not Delete From Specified Tables

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));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top