![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 3 of 3 total |
![]() |
Sun, Oct 5 2008 5:44 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Tim
This ZapInMemoryTable(ivp); generates this --------------------------- Debugger Exception Notification --------------------------- Project TfR.exe raised exception class EEDBError with message 'ElevateDB Error #300 Cannot lock the table ivp for exclusive access'. --------------------------- Break Continue Help --------------------------- I tried un-commenting "// WhichTable.Exclusive := True;" and that line is happy to set exclusive. function DoesTableExist(chk: TnlhTable): boolean; var Checker: TEDBQuery; begin Checker := TEDBQuery.Create(nil); try Checker.SessionName := chk.SessionName; Checker.DatabaseName := chk.DatabaseName; Checker.SQL.Text := 'SELECT * FROM Information.Tables WHERE Name = ' + QuotedStr(chk.TableName); Checker.ExecSQL; Result := Checker.RecordCount > 0; finally Checker.Close; Checker.Free; end; end; procedure ZapInMemoryTable(WhichTable: TnlhTable; ZapComponent: boolean = True); var Zapper: TEDBQuery; begin Zapper := TEDBQuery.Create(nil); try try if Assigned(WhichTable) and DoesTableExist(WhichTable) then begin WhichTable.DisableControls; try WhichTable.Close; // WhichTable.Exclusive := True; Zapper.SessionName := WhichTable.SessionName; Zapper.DatabaseName := WhichTable.DatabaseName; Zapper.SQL.Text := 'DROP TABLE ' + WhichTable.TableName; Zapper.ExecSQL; Zapper.Close; finally if ZapComponent then FreeAndNil(WhichTable) else WhichTable.EnableControls; end; end; except end; finally Zapper.Free; end; end; Roy Lambert |
Mon, Oct 6 2008 7:43 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Tim
Eventually found what was causing it. I have a query SELECT DISTINCT CAST (_StartPoint AS DATE) AS ivpDate FROM ivp ORDER BY ivpDate which I had to close. But the point still remains - why could I set exclusive to true using the table component, but the query couldn't to drop it? Roy Lambert |
Mon, Oct 6 2008 9:12 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Sussed it. I was setting exclusive, but not opening the table - now it bombs out on that. Next bit is trying to figure out what's changed in the TMS planner since I last worked on this form
![]() Roy Lambert |
This web page was last updated on Monday, June 30, 2025 at 12:49 PM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |