Replicating and naming dbs

Discussions for the HanDBase for iPad and it's conduits and desktop add-ons

Replicating and naming dbs

Postby Alanwestwood » Sun Aug 24, 2014 5:45 pm

I usually make a backup copy of a database before doing extensive modifications, either to the db itself or its forms. I'll then often rename either the original or the backup, either in the General db settings or by changing the filename where I've saved it (eg in a file manager such as FileBrowser). But if I reload the database to HanDBase, it ignores the new name and appends the original title with (1). It seems that somewhere in the db there is a hidden database name I can't alter. This can be very confusing, when I reload and HanDBase tells me its found a file with the same name - I don't know which db it means, and have overwritten the wrong file before now.

Please can this be looked at - hope I've explained what I mean, but I can send an exact sequence to replicate it if needed.

Many thanks, Alan.
Last edited by Alanwestwood on Sun Aug 24, 2014 6:10 pm, edited 1 time in total.
Alanwestwood
 
Posts: 62
Joined: Mon Aug 15, 2011 12:43 am

Re: Replicating and naming dbs

Postby Alanwestwood » Sun Aug 24, 2014 5:50 pm

PS this happens because I use an empty db copy to import records by csv on my iPhone then Open-In the db to my iPad and copy the records to the original db. Its a workaround because I can't Open-In csv data directly to HanDBase on my iPad. I know thats being fixed in the iOS8 release - not before time in my opinion ;-)

Cheers, Alan.
Alanwestwood
 
Posts: 62
Joined: Mon Aug 15, 2011 12:43 am

Re: Replicating and naming dbs

Postby curtterp » Mon Aug 25, 2014 5:16 am

Changing the file name is not changing the database name. You can only change the name of the database in the database properties. The database name is stored inside the database file.

I know that it is confusing to why the filename and database name is the same when you start a database by scratch. What happens is when you start from scratch, the first screen is asking for a database name. When you give it a name and press "Save", the file name is created from the database name. That is where the correlation between the database name and file name ends.
Have a good day

Curt
I am not a DDHSoftware employee, just a long time HanDBase user.... from Palm to Windows Mobile to Android, to iOS. Thanks to DDH, the database files transferred to each platform without a problem.
curtterp
 
Posts: 681
Joined: Tue May 26, 2009 6:41 pm
Location: Northern IL

Re: Replicating and naming dbs

Postby Alanwestwood » Mon Aug 25, 2014 6:58 am

Thanks Curt, I get that - but I still think that the filenames and database names should always correlate - I can see no reason at all that they are different. I have a database called "Cycling" with some forms - I copied it to FileBrowser, renamed it, and when I tried to reload it with the different name HanDBase insisted on calling the database and its forms Cycling(1). Fine, as you say, I thought I would just need to edit the name in properties. So I deleted the original, then in the database properties edited from Cycling(1) to Cycling again. But now when I attempt to email the database and forms, now correctly listed in HanDBase as Cycling, the email contains files called Cycling(1). Same for Open-In - so the change in database properties does not give me consistent names.

Its all extremely confusing - I simply want to be able to change a database name, even if it has to be in the properties, and get it used consistently, including when I export it by email or Open-In and then re-import. And ideally of course, if I change the filename in an external copy - wherever it is - the database name should match when the file is reloaded to HanDBase. Doesn't seem much to ask really ;-)

Many thanks, Alan.
Alanwestwood
 
Posts: 62
Joined: Mon Aug 15, 2011 12:43 am

Re: Replicating and naming dbs

Postby Alanwestwood » Tue Aug 26, 2014 3:30 am

And it gets worse - this database/filename handling is a pigs ear ;-)

I exported my database, now called Cycling in HanDBase, but Cycling(1).PDB and Cycling_HDF(1).PDB are exported by email. Then I deleted the files in HanDBase, so there could be no conflict with existing db/filenames, renamed the files to Cycling.PDB and Cycling_HDF.PDB and reimported to HanDBase. I get messages saying that "Cycling" and "Cycling_HDF" have been loaded, but in HanDBase I only find a file called Cycling(1) and it has no forms and does not connect to its related database (containing equipment data). In the Database Properties I change the name to Cycling, and all forms and relationships are fine again.

As I said - its a pigs ear (mess!). Sorry to be critical of an excellent app I wouldn't be without, but this is not a good. In my opinion it needs sorting, database names and filenames should not conflict like this - in fact why should they ever be different? I've been using relational databases on Macs and Windows since the 1980's (yep I'm an old guy) and this just does not seem right at all.

Cheers, Alan.
Alanwestwood
 
Posts: 62
Joined: Mon Aug 15, 2011 12:43 am

Re: Replicating and naming dbs

Postby curtterp » Tue Aug 26, 2014 4:48 am

Alanwestwood wrote:And it gets worse - this database/filename handling is a pigs ear ;-)

I exported my database, now called Cycling in HanDBase, but Cycling(1).PDB and Cycling_HDF(1).PDB are exported by email. Then I deleted the files in HanDBase, so there could be no conflict with existing db/filenames, renamed the files to Cycling.PDB and Cycling_HDF.PDB and reimported to HanDBase. I get messages saying that "Cycling" and "Cycling_HDF" have been loaded, but in HanDBase I only find a file called Cycling(1) and it has no forms and does not connect to its related database (containing equipment data). In the Database Properties I change the name to Cycling, and all forms and relationships are fine again.

As I said - its a pigs ear (mess!). Sorry to be critical of an excellent app I wouldn't be without, but this is not a good. In my opinion it needs sorting, database names and filenames should not conflict like this - in fact why should they ever be different? I've been using relational databases on Macs and Windows since the 1980's (yep I'm an old guy) and this just does not seem right at all.

Cheers, Alan.


I think this is why the database name is embedded in the file, and not used as the filename. When you use an external program (Windows Explorer, File Manager etc) to change the file name, any links or relationships are broken. If you change the name of the database within HanDBase, then the relationships can be preserved. By not tying the two together, it prevents problems with that.

The original codebase was written/nurtured/grown for the Palm Pilot. When Dave branched out to other devices, he kept the same look/feel/operations across the different platforms (Windows Mobile, iOS, Android, Blackberry) in order to have consistency across the platforms. Now all platforms do not have all the same features due to age (Android is the newest, thus the fewest features), but when you move from platform to platform, they operate pretty much the same. Very few companies can do that.

It might be possible that Dave could have checking to see if the filename changed, and change the database name to correspond to the filename when opening HanDBase, but that would be a huge undertaking (Dave would need to change it across all platforms), and it would slow down the program. Due to the nature of iOS and Android of staying open in a sleep state instead of closing when you leave HanDBase, there would also have to be error checking every time a user would go back to HanDBase to make sure filenames were not changed. This might also cause HanDBase to close and restart on it's own, which is not a good thing either.

The benefit is minimal and does not out weight the potential problems in my opinion. :)

There are time when I change a filename, and then when I open HanDBase, I realize that I forgot to change the database name in properties. :oops:
Have a good day

Curt
I am not a DDHSoftware employee, just a long time HanDBase user.... from Palm to Windows Mobile to Android, to iOS. Thanks to DDH, the database files transferred to each platform without a problem.
curtterp
 
Posts: 681
Joined: Tue May 26, 2009 6:41 pm
Location: Northern IL

Re: Replicating and naming dbs

Postby Brian_Houghton » Tue Aug 26, 2014 5:22 am

The database naming conventions are a bit confusing at first. Just as Curt described, though, the file itself, as seen through a traditional file manager, will have a unique name that can really be anything so long as it ends in .pdb. This allows for some creativity with filenames where version numbers, date stamps, etc can be used to help keep track of different versions of a file, much like we do with the conduit.

The database name, as assigned in Database Properties / General, is what is shown within HanDBase.

If we just opted for a single database name, and some of those unique names showing versions, dates, etc were to show within the list of databases available for use, it would be cumbersome at best.

As Curt noted, the method we use does also make working with relationships and links much easier.

Hope it makes sense that we have not gone down this path of two names for the sake of making things difficult. It does appear that way at first, but in this case, there is a bit of method to the madness.
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: Replicating and naming dbs

Postby Alanwestwood » Tue Aug 26, 2014 2:01 pm

Many thanks to you both for taking the time to respond. I appreciate it and I understand all your points.

However, the main underlying point that you both make is that the embedded database property name has to be overriding. Fine, I accept that. But in that case, when I edit the name property why is the new name not used for the export filenames and not embedded in the files for use at import? I can't see anything that either of you have said that explains that - which is my main issue - I have a file working properly with its forms and related or linked files and HanDBase simply will not export the files with the name I have set. It insists on using the original name or a name(1) assigned not by me but by HanDBase. As a result, at re-import these relationships are all lost.

Anyway, annoying as this is, it won't stop me using and recommending the app because it is the best iOS database by a long way now (or it will be when we get csv import by Open-In for the iPad, you're way behind the others on that). And I understand I've hit a brick wall here - and will just have to live with HanDBase exporting and importing the wrong database name until I can find a workaround to correct it.

Thanks again for the responses.

Cheers, Alan.
Alanwestwood
 
Posts: 62
Joined: Mon Aug 15, 2011 12:43 am

Re: Replicating and naming dbs

Postby dhaupert » Tue Aug 26, 2014 2:32 pm

Hi Alan,

Sorry for my delay in getting into the conversation. I think you've all covered some good points. I will explain my reasoning for the design decisions here to add some more food for thought:

Just to recap, the file name has nothing to do with the database name. The only time they correlate is when the file is first created when the file name is given to be DatabaseName.pdb as a default. Now here's why that is:

You can easily make a backup file of your database and name it whatever you want. For example, Cars.pdb can be renamed "cars before redesign in April.pdb" and it won't effect how the database works in any way. This is how the sync conduit handles backups- it copies the file as is to a backups folder and renames it with the date of the backup and the source (eg, desktop or device). To restore, you can simply copy this back, install it, whatever you want as the file name is once again irrelevant to HanDBase.

As Curt said if I just made the file name be the database name all the time, you could easily break all relationships.

As Curt also said, the way PDB files worked was based on the Palm PDB format which is the format HanDBase adopted a long time back. So I really didn't make this decision at all!

But to your point, one thing I could do differently is notice if you're renaming the database in HanDBase. If the file is named Untitled.pdb because it was created without you giving it a name and you now go back and give it a name, I could prompt and offer to rename the file to match it as well. That's something that could be done without too much fuss by watching the db name as you're editing it in the General screen. Would that help solve your dilemma?
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Replicating and naming dbs

Postby Alanwestwood » Tue Aug 26, 2014 3:31 pm

Thanks Dave, very much, for the additional explanation. Actually on the whole this hasn't given me too much trouble in real use, because I can just rename my imported database and that fixes the relationships fine. But I find it untidy ;-) All I really want to be able to do is make my database and file names match, as if they were created afresh.

I "think" your suggestion would work - though I am not at all sure whether the filename is actually "Untitled.pdb", since it seems to be Cycling(1).pdb. In any event the database property name is Cycling, not Cycling(1), and they don't match as they should.

However, I have now found a workaround that gets me back to square one. I'm not sure exactly why this has worked, I guess you can tell me though ;-) I exported (by Airdrop) the database to a different device (my iPhone), and noticed that the imported db had the same "Cycling" filename and database name, and also generated a Cycling.pdb file for email. So I deleted the complete database from my iPad, then copied the iPhone version back. The forms were lost, but the database name and relationships with other databases were fine. So I reimported a forms backup, and hey-presto, everything is fine - Cycling is the database name and the exported files are Cycling.pdb and Cycling_hdf.pdb. Perfect!

I'll be more careful in the future!

Thanks again.
All the best, Alan.
Alanwestwood
 
Posts: 62
Joined: Mon Aug 15, 2011 12:43 am

Next

Return to HanDBase for iPad

Who is online

Users browsing this forum: No registered users and 1 guest

cron