G
George Hester
I have a SQL statement which is an append query. Looks like this:
strApndKH_LH = "INSERT INTO [" & strTblNameKeyed & "] " & _
"SELECT [" & strTblNameLinked & "].* " & _
"FROM [" & strTblNameLinked & "];"
This I execute witrh:
dB.Execute strApndKH_LH, dbFailOnError
where Dim db as DAO.Database.
Then right below this db.Execute statement I have:
Call MakeTableFromSQL1(newTblName, strDbName, strDbPath, strFldName1, strFldName2, strTblNameKeyed)
This MakeTableFromSQL1 all it does is order strTblNameKeyed on one field and give me a new table newTblName.. No primary keys involved here.
This succeeds and fails about 50% of the time. When it fails I get "Could not update: Error #3260 currently locked by user 'Admin' on machine 'MyMachine." This is occurring at the point where the MakeTableQuery is started in the sub above.
It looks to be a problem of Locking. I tried FreeLock and everything came crashing down. Can't use that. Any ideas how I can free the locks after the first statement so the second one can succeed without this error? Thanks.
strApndKH_LH = "INSERT INTO [" & strTblNameKeyed & "] " & _
"SELECT [" & strTblNameLinked & "].* " & _
"FROM [" & strTblNameLinked & "];"
This I execute witrh:
dB.Execute strApndKH_LH, dbFailOnError
where Dim db as DAO.Database.
Then right below this db.Execute statement I have:
Call MakeTableFromSQL1(newTblName, strDbName, strDbPath, strFldName1, strFldName2, strTblNameKeyed)
This MakeTableFromSQL1 all it does is order strTblNameKeyed on one field and give me a new table newTblName.. No primary keys involved here.
This succeeds and fails about 50% of the time. When it fails I get "Could not update: Error #3260 currently locked by user 'Admin' on machine 'MyMachine." This is occurring at the point where the MakeTableQuery is started in the sub above.
It looks to be a problem of Locking. I tried FreeLock and everything came crashing down. Can't use that. Any ideas how I can free the locks after the first statement so the second one can succeed without this error? Thanks.