?? Relationship between DATABASE and FILE names ??

Discuss the HanDBase for Windows Desktop program, conduits, and add-ons.

?? Relationship between DATABASE and FILE names ??

Postby Shepherd Jim » Fri Dec 03, 2010 12:25 pm

I think I've seen where, usually after me maybe setting up test or trial pdb versions by doing some "save as"s so as to protect db's I didn't want to lose, where there the NAME of a database as seen "in" HDB is DIFFERENT than the FILEname that I might see in Windows Explorer.

Is this the case? How/why does this happen and how can I avoid it?

Tnx -- Jim
i wish i knew then what i know now
Shepherd Jim
 
Posts: 116
Joined: Mon May 25, 2009 3:28 pm
Location: Bristol, Maine USA

Re: ?? Relationship between DATABASE and FILE names ??

Postby dhaupert » Mon Dec 06, 2010 12:03 pm

The name of a database is stored within the database. The filename can really be anything you want- for example, in Windows, when you save a file, it asks you what file name to save it as. On most mobile devices, we just name the file name using the database name, but adjusting for characters that are not 'legal' for file names. For example- there are certain characters we will change to an underscore (ie, _):
*, \, :, <, >, ?, /, . and &

We also rename spaces to be underscores- even though Windows allows spaces in filenames as does Mac, it's just a good practice for compatibility with older OSes.

For tables that are being related/joined in some way, we don't really use the file name except as a way to quickly find the related file- for example, if you have a database that is linked to a database called 'My Friends', we will first look for databases with file names like My_Friends.PDB to speed up the process. If those don't exist, then I go through one by one the files that are in the folder to find the matching database. Thus the file names matching have some benefit, but nothing critical!

Regardless, you can rename a database and the file name will stay the same name- they are not joined at the hip so to speak, but rather independent!
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: ?? Relationship between DATABASE and FILE names ??

Postby Shepherd Jim » Wed Dec 08, 2010 9:59 am

dhaupert wrote:...<snip>...The filename can really be anything you want- for example, in Windows, when you save a file, it asks you what file name to save it as. On most mobile devices, we just name the file name using the database name ...<snip>....We also rename spaces to be underscores- even though Windows allows spaces in filenames as does Mac, it's just a good practice for compatibility with older OSes.


I have to admit I've never been comfortable using " " blanks in filenames. It doesn't present a tidy look when looking at FULL tree names -- e.g.

C:\documents\jim\private messages\Day One Notes\Thu eve.txt

Showing underscores ties everything together:

C:\documents\jim\private_messages\Day_One_Notes\Thu_eve.txt

dhaupert wrote:For tables that are being related/joined in some way, we don't really use the file name except as a way to quickly find the related file- for example, if you have a database that is linked to a database called 'My Friends', we will first look for databases with file names like My_Friends.PDB to speed up the process. If those don't exist, then I go through one by one the files that are in the folder to find the matching database. ...<snip>...


Dave, you sort of lost me there? "...we will first look for databases with file names like My_Friends.PDB to speed up the process." Are you talking there about how HDB behaves when the user is in the process of naming fields and setting up a link/relationship with another pdb -- whereby HDB tries to "help" find the other pdb the user might be intending to link to?

...and the bottom line on the filename/database name conundrum = Now I have a pretty good handle on what's been going on and will exercise some care when "saving as" and changing database names.

Summation of the basic possibilities:
1) database "DATAbase_1" in a file named DATAbase_1.pdb -- created by HDB when first setting up a database called "DATAbase_1"
2) database "DATAbase_1" in a file named BackUp_of_DB1.pdb -- after a "Save As" of 1)
3) database "BackUp_of_DB1" in a file named DATAbase_1.pdb -- after a database "name change" of 1)
etc ad infinitum

I hadn't appreciated just how much flexibility we users have here. It'll obviously be VERY beneficial to adopt some rational naming conventions and stick to them across the board and time. I can tell you that I have been totally confused on many occasions when I went back in time in the deep places of my hard drive or Home Server to "find" the LAST (read: "hopefully the most accurate/current"?) version of a database I had not used for a year or two.
i wish i knew then what i know now
Shepherd Jim
 
Posts: 116
Joined: Mon May 25, 2009 3:28 pm
Location: Bristol, Maine USA

Re: ?? Relationship between DATABASE and FILE names ??

Postby kronhead » Mon Jan 10, 2011 11:08 am

I have a related problem with file names.

I started with a date base called Exercise V2. This was both the internal name and file name. No underscore. Don't know how I created it, but that's definitely what I had - confirmed by looking at my automated system backups. I have been editing and syncing that file with no problems for a couple of months.

I wanted to do some fairly significant changes, so I was trying to figure out how to build a new version of this file - I thought there was some way to copy the structure, or some or all of the records AND the structure. Could not find it - did I miss something? Anyway, the only thing I could find was Save As. So I did Save As and specified Exercise V3. And I am pretty sure I said to install it for my Android Phone user.

I go to open the new database by clicking on Open - and I have THREE databases called Exercise V2. That freaked me out - then I noticed the file names - and one of them is Exercise V3. That's good. But there are still two that are Exercise V2. Oh - I see one is Exercise_V2. And there is a copy of THAT file in INSTALL. No Exercise V3. Why not, since I said to Install it, when i saved it?

OK - so I can edit the properties of the V3 file - change the database name to V3. And I assume I can say to install it. But - what am I going to see on the phone for V2 after my next sync? And which V2 file should I use on the PC to have it continue to sync (assuming I want to)?

Confused - and afraid to sync, or edit V2, until I understand which is the real database.
Dan
kronhead
 
Posts: 100
Joined: Sun Jul 04, 2010 11:12 am

Re: ?? Relationship between DATABASE and FILE names ??

Postby Shepherd Jim » Mon Jan 10, 2011 12:19 pm

Hey Dan:

I wouldn't be the right person to get you back on track in the best of times -- HELLO, MR. HAUPERT & CREW! ;-)

...and these are not the best of times. I'm battling a Richter 5+ headcold. I gave in and started taking Tylenol Cold which simply makes you forget you're sick by transporting you somewhere usually only reachable via the eating of special mushrooms.

kronhead wrote:...<snip>... so I was trying to figure out how to build a new version of this file - I thought there was some way to copy the structure, or some or all of the records AND the structure. Could not find it - did I miss something? Anyway, the only thing I could find was Save As. So I did Save As and specified Exercise V3. ...<snip>...


Yeah, I think you're remembering the "Copy Template" menu option that was available in HDB (Palm) on the handheld device. I too miss that BIGTIME. I used it all the time to create on-the-fly ad hoc "child" copies of the main prime database. Like you the only fairly close workaround I've found is to "copy as" the database, then delete all the records, (NOW I have an empty "template" of the db) and then import or export to move records in from somewhere else.
i wish i knew then what i know now
Shepherd Jim
 
Posts: 116
Joined: Mon May 25, 2009 3:28 pm
Location: Bristol, Maine USA

Re: ?? Relationship between DATABASE and FILE names ??

Postby dhaupert » Tue Jan 11, 2011 4:16 pm

Hi there,

Which platform are you looking for the Copy Template option? We have it on most mobile platforms (eg, iPhone, Android, etc) but under a different name. In them, when you are in the Choose Database screen and press the + button to add a new database, there is a choice 'Use Existing Template'. That does the same thing as the old Palm Copy Template option!

On the desktop, there isn't an exact option, but it can be done using the following steps:

- Select File|Save As, give file a new name
- Select Configure| DB Properties and go to General and give the database a new name
- Now select Tools, Delete Records and delete _all_ records.

That should give you the same behavior as the copy template did. To answer your question kronhead, when you renamed the file, it does not rename the database- they are not tied together. The file name is an OS thing and at any time you can rename a file (for example, the backups created by our conduit have the same database name, but the file name is different (has the date and time of the backup in the name). The database name is stored within the database and renaming it has to be done through HanDBase.

So when you renamed your Exercise v2 to Exercise v3, it sounds like you just renamed the file, which means you now have two databases with different files and filenames, but the same database name. You'll have to figure out which of those databases is v3 by renaming one of the databases (choose one randomly) and then see on the desktop if it matches the filename for v3. If not, switch them around and sync again.

Hope this helps!
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: ?? Relationship between DATABASE and FILE names ??

Postby Shepherd Jim » Tue Jan 11, 2011 11:33 pm

dhaupert wrote:...<snip>...Which platform are you looking for the Copy Template option? We have it on most mobile platforms (eg, iPhone, Android, etc) but under a different name. In them, when you are in the Choose Database screen and press the + button to add a new database, there is a choice 'Use Existing Template'. That does the same thing as the old Palm Copy Template option!....<snip>...


Okay Dave -- that works. I'm not sure how often I would use the "Download a New Template" option. Picking a db structure from the HDB website "Gallery" would seem a lot hit or miss -- all you can see is the database name that the contributor gave it.

I was glad to see that I was not the only one to not have grasped the idea that the database name and the "containing" filename are independent of one another. The disconnection gives us all kinds of power, but does require careful consideration and attention to detail to avoid severe confusion.
i wish i knew then what i know now
Shepherd Jim
 
Posts: 116
Joined: Mon May 25, 2009 3:28 pm
Location: Bristol, Maine USA

Re: ?? Relationship between DATABASE and FILE names ??

Postby kronhead » Wed Jan 12, 2011 10:37 am

dhaupert wrote:To answer your question kronhead, when you renamed the file, it does not rename the database- they are not tied together. The file name is an OS thing and at any time you can rename a file (for example, the backups created by our conduit have the same database name, but the file name is different (has the date and time of the backup in the name). The database name is stored within the database and renaming it has to be done through HanDBase.

So when you renamed your Exercise v2 to Exercise v3, it sounds like you just renamed the file, which means you now have two databases with different files and filenames, but the same database name. You'll have to figure out which of those databases is v3 by renaming one of the databases (choose one randomly) and then see on the desktop if it matches the filename for v3. If not, switch them around and sync again.

Hope this helps!


Doesn't really help. I did not rename any files. Did not say I had renamed any files. I did not rename any databases. The only thing I did was Save As. I have not made any changes to the files - they are all exactly the same at the moment. But I don't know what files to use for what databases at this point.

But I guess I will just flail away at it and hope for the best ...

Trying hard here not to make remarks I will regret ...

Dan
kronhead
 
Posts: 100
Joined: Sun Jul 04, 2010 11:12 am

Re: ?? Relationship between DATABASE and FILE names ??

Postby dhaupert » Wed Jan 12, 2011 10:54 am

kronhead wrote:
dhaupert wrote:To answer your question kronhead, when you renamed the file, it does not rename the database- they are not tied together. The file name is an OS thing and at any time you can rename a file (for example, the backups created by our conduit have the same database name, but the file name is different (has the date and time of the backup in the name). The database name is stored within the database and renaming it has to be done through HanDBase.

So when you renamed your Exercise v2 to Exercise v3, it sounds like you just renamed the file, which means you now have two databases with different files and filenames, but the same database name. You'll have to figure out which of those databases is v3 by renaming one of the databases (choose one randomly) and then see on the desktop if it matches the filename for v3. If not, switch them around and sync again.

Hope this helps!


Doesn't really help. I did not rename any files. Did not say I had renamed any files. I did not rename any databases. The only thing I did was Save As. I have not made any changes to the files - they are all exactly the same at the moment. But I don't know what files to use for what databases at this point.

But I guess I will just flail away at it and hope for the best ...

Trying hard here not to make remarks I will regret ...

Dan



Dan, when you use File Save as, it's same net effect of copying and then renaming a file. It's saving the file with the new file name which means the same thing to you and the same steps I outlined still apply. Perhaps I can expand on them so that they make more sense to you:

- On your mobile device, choose either of the databases with the name Exercise V2, and go to the DB Properties for it. Now go to General and change the name of the database to Exercise v3.
- Sync with your desktop.
- Depending on how your guess went, you'll now have one of two possibilities:
A database with the file name: Exercise_v2.pdb but the database name: Exercise V3
or a database with the file name: Exercise_v3.pdb with the database name: Exercise V3

If the latter is your case, congratulations, you guessed correctly and now have two uniquely named databases with matching file names. If the former, you'll have to go back to the mobile device and do the following:
- Open Exercise V3, go to DB Properties, General and rename this to Exercise Ver2 (note that I am using Ver2 and not V2 here. This is because you can't rename a database to the same name as another database already installed. So it takes a three step method to swap the names)
- Open Exercise V2 and rename this to Exercise V3
- Open Exercise Ver2 and rename this to Exercise V2

I hope this makes sense. If not, don't hold back and let out your frustrations. I'm a big boy and can take it! ;)
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: ?? Relationship between DATABASE and FILE names ??

Postby kronhead » Wed Jan 12, 2011 12:09 pm

Well, first of all, this was not on my phone, this was on my PC. And I had not done a sync since discovering the weirdness of a newly created exercise_v2 with an underscore, when I had been syncing exercise v2 since buying handbase.

I decided to just do a sync and see what happened. And what happened was Handbase discovered a bunch of databases not on the phone, and archived them - including file exercise_v3 (which had a database name of exercise v2, and which I thought it would INSTALL, not archive), and exercise_v2 (which also had a database name of exercise v2). The only one it left was exercise v2. Which is fine with me. The log showed this - but it only has database name, not file names - so you cannot really tell what it does.

So - I edited the properties of V2, changed it's database name to V3, and did a "save as" to a different directory - forgetting the underscore. When I was asked if I wanted to install it, I said yes - which I guess created a copy in the mirror directory, with an underscore, and also in the install directory. And when I did a sync, I got V3 on the phone. Now I can attempt to make the changes i want, knowing I have V2 safe.

My main complaint is that the procedure I followed in the above paragraph is not intuitive or obvious at all, and I don't think it's documented anywhere - except here on the forums. I don't believe that. if I had saved it in the mirror directory, it would have worked properly - because i tried that with my original V3. I had not used the mirror directory when I created my first data base - I used a separate directory - and I probably only discovered I could not use that AFTER doing the install, when I tried some tests, and data did not sync.

Anyway - now I am fighting how to re-import data that got somewhat corrupted (nothing serious - just not great) when I migrated via CSV files originally. Oh - and I have a database on the phone that does not exist on my PC - when I delete it on the phone, and do a sync, it re-appears on the phone. I don't really care - it's just annoying - so I moved it to a category I do not use, and hopefully I will forget about it eventually. Unless sync puts the category back the way it was ...

Dave - you do a great job of support, always with good humor - that's why I said I did not want to make remarks I would regret. But I find this part of Handbase unnecessarily complex, undocumented, and prone to error - errors by ME. (Seems like I had some other complaints, too - fortunately, they have been forgotten.)

Also - I love user forums - but I also like direct support requests, when I have a specific problem - and it's not clear if there is a difference at DDH, or which I should use ...

Dan
kronhead
 
Posts: 100
Joined: Sun Jul 04, 2010 11:12 am

Next

Return to HanDBase for Windows

Who is online

Users browsing this forum: Bing [Bot] and 2 guests