Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 2 of 2 total |
Performing database maintenance programmatically |
Fri, Feb 23 2007 9:30 AM | Permanent Link |
"John Taylor" | Question...
I have a series of apps that use the same database and periodically I'll need to add a new field somewhere, that's where the problem comes in. I know exclusive access is needed to add the field so if the other applications are accessing the table it can't happen. I would however like an IsFieldInTable function that doesn't require that and here is what I've been using, which does (I think) required exclusive access... function IsFieldInTable(const path : string;Table : TDbIsamTable;const Fieldname : string) : boolean; var exists : boolean; begin exists := false; Table.RestructureFieldDefs.update; try exists := (Table.RestructureFieldDefs.IndexOf(Fieldname) <> -1); except end; result := exists; end; Is there a better way ? How about just running a query on the table for the newly required field and test the exception ? Thanks all ! JT |
Tue, Feb 27 2007 6:26 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | John,
<< I have a series of apps that use the same database and periodically I'll need to add a new field somewhere, that's where the problem comes in. I know exclusive access is needed to add the field so if the other applications are accessing the table it can't happen. I would however like an IsFieldInTable function that doesn't require that and here is what I've been using, which does (I think) required exclusive access... >> RestructureFieldDefs.Update does not require exclusive access. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Sunday, May 19, 2024 at 08:46 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |