Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 10 of 17 total |
.lck files and paths configuration |
Tue, Feb 5 2008 9:31 AM | Permanent Link |
Luis Concepcion | Hi!
Ok, I'm afraid that my application is not installed or configured properly. Many people says that application .EXE have to be installed in "...\Program Files\MyApp" folder. Ok. DataBase Administrators say that DataBase files, config files, etc... have to be installed in "...\MyApp\Data" folder. Ok. But now, I have read that data files (database, config files, etc...) have to be installed in "...\[AllUsers]\[AppData]\MyApp\Data" folder. Is it really necessary? because I would have to re-code all my application to use the new folders. The problems appear when using a database application in a multi-user OS, without enough user permissions and rights. Is it really 'better' to copy the database files to "AppData" folders and the EXE file to "ProgramFiles" folder? any 'pros' and 'cons'? Another 'little' problem is that, after designing or printing a report with ReportBuilder, or making some runtime sql queries with my app, a .LCK file appears in my desktop. I know that there are temp folders, private folder, etc... but I don't know how to set it up in a shared-mode environment and in a client-server one. Any differences? Only a simple line of code to set up the PrivateDir folder? I'm using DBISAM 4.25 and Delphi 7 pro. Thanks!!! |
Tue, Feb 5 2008 12:50 PM | Permanent Link |
"Malcolm" | Hi Luis
Use the Database.Session.PrivateDir to say where the .lck file should be created. Otherwise whenever it is needed it will be created in the current working directory. It is highly recommended that you follow the MS guidance on locating your program and data files. Otherwise you will keep running into trouble. Vista is less forgiving than earlier Windows versions, but since Windows NT, MS has been advising developers to use the Program Files tree only for files for which the user does not need write access. User writeable files should be under either the individual user's application data folder tree or in the common application data folder tree, depending on the program's data needs (roaming/shared/etc). The complication is that the folder names and locations differ with Windows versions and Languages. You really should be using the Windows Shell constants to obtain the actual paths if you want painless installations on all Windows variants. What Installer do you use? There are hundreds of posts about this issue on the InnoSetup newsgroups and I expect the same applies to other Installers. You will need to modify your code .. but it should be a one-time exercise. At startup, just grab the application folder from the .exe location and ask Windows for the common application data folder (or whatever), then you can set variables (eg. AppPath and DataPath) to the actual locations and use those throughout your code. Malcolm |
Tue, Feb 5 2008 7:36 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Luis,
Malcolm's answer is spot-on and very complete. -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Feb 6 2008 6:11 AM | Permanent Link |
=?iso-8859-1?Q?Santy_Concepci=F3n?= | HI, Malcolm...
Thanks for your complete answer. I have a doubt about PrivateDir. If I have 3 DBISAMDataBase in the same form, can all of them have the same PrivateDir? Will be any interference? Thanks! "Malcolm" <malcolm@spam.will.bounce> escribió en el mensaje de noticias:9815EADA-DC31-4F91-9DB3-50A0393D668C@news.elevatesoft.com... > Hi Luis > > Use the Database.Session.PrivateDir to say where the .lck file should > be created. Otherwise whenever it is needed it will be created in the > current working directory. > > It is highly recommended that you follow the MS guidance on locating > your program and data files. Otherwise you will keep running into > trouble. Vista is less forgiving than earlier Windows versions, but > since Windows NT, MS has been advising developers to use the Program > Files tree only for files for which the user does not need write > access. User writeable files should be under either the individual > user's application data folder tree or in the common application data > folder tree, depending on the program's data needs (roaming/shared/etc). > > The complication is that the folder names and locations differ with > Windows versions and Languages. You really should be using the Windows > Shell constants to obtain the actual paths if you want painless > installations on all Windows variants. > > What Installer do you use? There are hundreds of posts about this > issue on the InnoSetup newsgroups and I expect the same applies to > other Installers. > > You will need to modify your code .. but it should be a one-time > exercise. At startup, just grab the application folder from the .exe > location and ask Windows for the common application data folder (or > whatever), then you can set variables (eg. AppPath and DataPath) to the > actual locations and use those throughout your code. > > Malcolm > |
Wed, Feb 6 2008 11:19 AM | Permanent Link |
"Malcolm" | Santy Concepción wrote:
> HI, Malcolm... > > Thanks for your complete answer. > I have a doubt about PrivateDir. If I have 3 DBISAMDataBase in the > same form, can all of them have the same PrivateDir? Will be any > interference? > Santy I will leave that one to Tim. I don't have that setup so I would be guessing. Malcolm -- |
Wed, Feb 6 2008 11:30 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Santy
No problem - it has to be able to deal with stuff in threads which require a separate database and session after all. Roy Lambert |
Wed, Feb 6 2008 2:06 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Santy,
<< I have a doubt about PrivateDir. If I have 3 DBISAMDataBase in the same form, can all of them have the same PrivateDir? Will be any interference? >> Yes, they can all share the same PrivateDir setting. -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Feb 14 2008 3:21 PM | Permanent Link |
Mark Wilsdorf | Tim,
I'm having a problem with the dbisam.lck file location as well. (In ended up in this message thread after searching the newsgroups...) I assumed that if all TdbIsamDatabase components share the same Session ("Default"), and that if I set: dbisamtb.Session.PrivateDir := ...some path... in my DataModule that gets instanced first, then only one dbisam.lck file should be created (in "...some path..."). Correct? Well, it's not working that way for me. I've stepped through my code and find there's one .lck file (in the folder assigned by the PrivateDir property) until I reach a certain point, then a second .lck file is created in the same folder where the tables are. The following two routines show where the 2nd .lck file is being created. begin ATable := TDBISAMTable.Create(nil); try with ATable do begin Databasename := ACompanyFolderPath; //...just a path string TableName := Strings[ii]; Active := False; case dbiCheckTableVersion(ATable, GetTableMajorVer(TableID)) of ... ... finally ATable.Free; end end; function dbiCheckTableVersion(ATable: TDBISAMTable; CurrVersionNum: Integer): TdbiVersionResult; { Return table version flag w/r/t CurrVersionNum. } begin with ATable do //***** The 2nd .lck file is created when the following line executes ***** if not Exists then Result := vrTableNotExist else if CurrVersionNum = 0 then Result := vrNoVersionInfo //Tell caller no version info was passed //We only observe UserMajorVersion, not UserMinorVersion else if UserMajorVersion > CurrVersionNum then Result := vrNewer else if UserMajorVersion < CurrVersionNum then Result := vrOlder else Result := vrSame; end; How is my thinking wrong here? Thanks, Mark Wilsdorf Flagship Technologies, Inc. QuickBooks™ Add-Ons and Solutions You Can Use http://www.goflagship.com |
Thu, Feb 14 2008 3:32 PM | Permanent Link |
Mark Wilsdorf | Well, no, after checking again...
No .lck file is ever created in the folder specified by dbisamtb.Session.PrivateDir := ...some path... They're all created in folders where tables reside. And I've tried several folders (common_user_appdata, windows temp folder, etc.), including some per-user folders my app writes to, so permissions shouldn't be the problem. Ideas? Thanks, Mark Wilsdorf |
Thu, Feb 14 2008 3:35 PM | Permanent Link |
"Jose Eduardo Helminsky" | Mark
Session.PrivateDir will be used only to store temporary data. There are some operations that DBISAM needs to create temporary tables and these tables are created in this path (session.privatedir). Eduardo |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Tuesday, May 7, 2024 at 06:25 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |