M
Mark
I am working in an Access 97 database.
I am trying to delete a temporary table (used for
importing data)that I have just worked with in the
previous code.
I am getting an Error 3211:
"The database engine couldn't lock the
table "tblABAgClaims" because it's already in use by
another person or process.
How do I release the table in the code so that I can
delete it?
See the code below
Thanks if you have an answer!
Mark Weiler
Ontario Canada
Set wsCurrent = DBEngine.Workspaces(0)
Set dbCurrent = wsCurrent.Databases(0)
wsCurrent.BeginTrans
strSQL = "UPDATE tblMeterLocation INNER JOIN
tblABAgClaims ON (tblMeterLocation.MeterLocationID =
tblABAgClaims.MeterLocationID) AND
(tblMeterLocation.ApplicantID = tblABAgClaims.ApplicantID)
SET tblMeterLocation.ABAgComments = [tblABAgClaims]![AB
Agriculture Comments], tblMeterLocation.ABAgDateReceived =
Date() " & _
"WITH OWNERACCESS OPTION;"
Set qdfUpdateClaims = dbCurrent.CreateQueryDef("",
strSQL)
'qdfUpdateClaims.Parameters(0) = Z
qdfUpdateClaims.Execute dbFailOnError
wsCurrent.CommitTrans 'applies all of the
transactions to all of the tables
DoCmd.DeleteObject acTable, "tblABAgClaims"
Exit Sub
I am trying to delete a temporary table (used for
importing data)that I have just worked with in the
previous code.
I am getting an Error 3211:
"The database engine couldn't lock the
table "tblABAgClaims" because it's already in use by
another person or process.
How do I release the table in the code so that I can
delete it?
See the code below
Thanks if you have an answer!
Mark Weiler
Ontario Canada
Set wsCurrent = DBEngine.Workspaces(0)
Set dbCurrent = wsCurrent.Databases(0)
wsCurrent.BeginTrans
strSQL = "UPDATE tblMeterLocation INNER JOIN
tblABAgClaims ON (tblMeterLocation.MeterLocationID =
tblABAgClaims.MeterLocationID) AND
(tblMeterLocation.ApplicantID = tblABAgClaims.ApplicantID)
SET tblMeterLocation.ABAgComments = [tblABAgClaims]![AB
Agriculture Comments], tblMeterLocation.ABAgDateReceived =
Date() " & _
"WITH OWNERACCESS OPTION;"
Set qdfUpdateClaims = dbCurrent.CreateQueryDef("",
strSQL)
'qdfUpdateClaims.Parameters(0) = Z
qdfUpdateClaims.Execute dbFailOnError
wsCurrent.CommitTrans 'applies all of the
transactions to all of the tables
DoCmd.DeleteObject acTable, "tblABAgClaims"
Exit Sub