Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Search/Update subform from within parent form (Read 2867 times)
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Search/Update subform from within parent form
Mar 16th, 2007 at 6:03pm
Print Post Print Post  
I've been testing the functions of our database and tried to retrieve a subform record-specifically all repairs entered on a specific date.  I ebtered the date on the subform, hit F-10 and everything froze...I can search/update from within the parent form fine...

I did some forum searching and found a few instances that sound similar to what I'm experiencing.  Is it not possible to perform functions in search/update on a subform and have that child data retrieved?
The subform is "relational" by serial numbers of our equipment, since that is the unique factor that ties everything together between the parent and child.

Here's a snapshot of my search spec (date field on subform)...pressing F-10 locks up the program.

http://us.a2.yahoofs.com/users/456dd110z2ef31adb/e5c3scd/__sr_/b826scd.jpgphgst....
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Search/Update subform from within parent form
Reply #1 - Mar 16th, 2007 at 6:42pm
Print Post Print Post  
Hello,

A relational subform search is going to take longer than a search on a parent form or a search on a Natural subform. How long it takes is going to depend on the number of child records and the number of parent records.

Mark, I'm sure will correct me if I am wrong on this, but a simplified rundown of my understanding of what is happening is as follows.
Sesame finds all records in the subform that match the retrieval criteria
Sesame then has to find all the parents for each one of those child records. Since each child record can have more than one parent Sesame must loop through all the parent records for each child record that matches the criteria, adding parent records to the result set that have not already been added.
Then for the First record Sesame must Search through all the records in the child database to find all the sub-records that are linked to that parent record.

If you have a large application, this can take some time and Sesame may appear as if it has frozen, when it is actually just running a search. The Mode box in the upper right should say Working and you should see Sesame using some CPU.

Is there any specific reason that you are using Relational linking and not natural linking?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Search/Update subform from within parent form
Reply #2 - Mar 23rd, 2007 at 10:22pm
Print Post Print Post  
Quote:
Hello,

A relational subform search is going to take longer than a search on a parent form or a search on a Natural subform. How long it takes is going to depend on the number of child records and the number of parent records.

Mark, I'm sure will correct me if I am wrong on this, but a simplified rundown of my understanding of what is happening is as follows.
Sesame finds all records in the subform that match the retrieval criteria
Sesame then has to find all the parents for each one of those child records. Since each child record can have more than one parent Sesame must loop through all the parent records for each child record that matches the criteria, adding parent records to the result set that have not already been added.
Then for the First record Sesame must Search through all the records in the child database to find all the sub-records that are linked to that parent record.

If you have a large application, this can take some time and Sesame may appear as if it has frozen, when it is actually just running a search. The Mode box in the upper right should say Working and you should see Sesame using some CPU.

Is there any specific reason that you are using Relational linking and not natural linking?

-Ray


Ray,
Thanks for the reply and confirming my "suspicions".  We (meaning I, since I have designated myself as the office scapegoat for all things Sesame)...in any event, I chose Relational Linking for only one reason: The primary search criteria for our merged databases is the Serial Number for our pieces of equipment.  I have toyed with the idea of re-designing a backup and trying Natural Linking...I should attempt that this weekend during my leisure time...and also get working with 2.0 Beta!  I'm having too much fun really...I just need to stretch the days from 24 to about 32 hours so I can do everything I want to do  Roll Eyes

Any advice on changing the design from Relational to Natural linking?  Or should I just get in there and go for it?

You people are great btw...thanks for being here. Wink
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Search/Update subform from within parent form
Reply #3 - Mar 23rd, 2007 at 11:29pm
Print Post Print Post  
charliebrown wrote on Mar 23rd, 2007 at 10:22pm:
Any advice on changing the design from Relational to Natural linking?  Or should I just get in there and go for it?
You people are great btw...thanks for being here. Wink


Make a copy of your application files!
Export your records to ASCII
Redesign your application
Delete the data records
Redesign your form so it has a natural form where the relational form was
Save your design to a new application file (or reconcile to a copy of your app)
Import the ASCII file.

After all is done, if you choose, you can get rid of the key fields/elements, as they are no longer necessary. Some people choose to keep them just to make sure that everything matches up. But since it is no longer used to create the relation, it is no longer functionally necessary for Sesame.

Most importantly, WORK ON COPIES of your files.

Under 1.x naturally linked records have a great speed advantage. If your relation is one to many, the natural choice is natural linking.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Search/Update subform from within parent form
Reply #4 - Mar 24th, 2007 at 4:23am
Print Post Print Post  
I always keep a KEY FIELD on Parent and Child databases, even if using Natural Linking.

Although Sesame can ID which "sub records" go with each parent, the user cannot tell.  If you have the Key Field on the sub records matching the Key Field on the Parent records, then YOU can easily identify the sub records that belong to any Parent.  Make the Key Field invisible and/or Read Only on the forms, but make them visible when browsing at the  database level of the subform.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Search/Update subform from within parent form
Reply #5 - Mar 26th, 2007 at 4:07pm
Print Post Print Post  
Quote:
charliebrown wrote on Mar 23rd, 2007 at 10:22pm:
Any advice on changing the design from Relational to Natural linking?  Or should I just get in there and go for it?
You people are great btw...thanks for being here. Wink


Make a copy of your application files!


Most importantly, WORK ON COPIES of your files.

.


Oh yes!  Copy and backup everything FIRST...that I always do.  My coworker, wants to get into the designer and "make it look......" who knows what he's got cooking in his cranium?  In any6 event, I said, "Sure!  Here's the manual, and I'll put a copy of the db in your directory....LEAVE THE MASTER DATABASE ALONE UNTIL I TEST WHAT YOU HAVE DONE!!!!!!!!!!!!!!  understand? 

he doesn't understand why I'm so "protective" ...if he works in the master db, HE WILL  Angry   Wink
  
Back to top
 
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Search/Update subform from within parent form
Reply #6 - Mar 29th, 2007 at 10:09pm
Print Post Print Post  
Quote:
charliebrown wrote on Mar 23rd, 2007 at 10:22pm:
Any advice on changing the design from Relational to Natural linking?  Or should I just get in there and go for it?
You people are great btw...thanks for being here. Wink


Make a copy of your application files!
Export your records to ASCII
Redesign your application
Delete the data records
Redesign your form so it has a natural form where the relational form was
Save your design to a new application file (or reconcile to a copy of your app)
Import the ASCII file.

After all is done, if you choose, you can get rid of the key fields/elements, as they are no longer necessary. Some people choose to keep them just to make sure that everything matches up. But since it is no longer used to create the relation, it is no longer functionally necessary for Sesame.

Most importantly, WORK ON COPIES of your files.

Under 1.x naturally linked records have a great speed advantage. If your relation is one to many, the natural choice is natural linking.


Mark,

Sorry to bother you on this-probably something silly I'm doing...I've taken your and Ray's advice and testing Natural vs. Relational linking of my Parent/Child databases.  I'm getting some data corruption when I import my files back into my program after redesigning my subform...missing records and some Y2K date issues as well (not worried about the date issues as much as the missing records).  Should I be exporting my data seperately from the two merged databases and impoting them back in the same manner? Or should I do an export of the combined (merged) records-which takes a very long timeas I found out this morning?  I've tried both methods and had problems with each.  (I just know this is pilot error on my part....grrrr Smiley...any suggestions appreciated...I'll experiment with my export settings which I did not tamper with-I left the check boxes as I found them (default).

Charlie
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Search/Update subform from within parent form
Reply #7 - Mar 29th, 2007 at 11:19pm
Print Post Print Post  
You will want to export from the highest level form and include all the subforms and elements therein. It will take a while if there are a lot of forms / records / elements / fields. If you are experience field missmatch, make double-sure that you are importing in the same order as you exported.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Search/Update subform from within parent form
Reply #8 - Mar 30th, 2007 at 3:37am
Print Post Print Post  
Quote:
You will want to export from the highest level form and include all the subforms and elements therein. It will take a while if there are a lot of forms / records / elements / fields. If you are experience field missmatch, make double-sure that you are importing in the same order as you exported.


Mark...you are reading my mind...or vice versa (which would be better:)...I did have a mixed order on a couple of fields and was concerned about the time it was taking to export (there are a lot of records, etc.)  I'm working with "new" copies and will use extra care this time around.  Thanks again!

Charlie
  
Back to top
 
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Search/Update subform from within parent form
Reply #9 - Apr 16th, 2007 at 3:58pm
Print Post Print Post  
Quote:
You will want to export from the highest level form and include all the subforms and elements therein. It will take a while if there are a lot of forms / records / elements / fields. If you are experience field missmatch, make double-sure that you are importing in the same order as you exported.


I had to put off some work on our database to do what these folks actually hired me to do (the nerve of some people Roll Eyes
I've discovered a couple of things:  My database is corrupt to some extent...I've exported and imported our data numerous times and have, for lack of a better term, a mess...the number of records imported is way off-too many repair records and less inventory records.  I have "money" in my date fields; just a few examples.  I was reading through the text files of my exported data and there are some very strange fields there...it "appears" someone was trying to search in the add data mode using the .."search" spec and it has been stored as a record...little things like that...grrrrrrr...(I know, trash in, trash out) Angry

I'm looking at a couple of alternatives...go through each of the 7000 or so records and clean this mess up or go back to the original Q&A database and clean it up there and translate again.  (I think some of this mess may have been there when I Translated to Sesame originally, though I followed the Translation guide to the letter and had no issues then).  I also wonder if any of our saved reports from Q&A are having an impact on the export/import problems I'm experiencing?  I was very careful in exporting/importing in the exact order, etc.

We've added somewhere around 100 new records since we started using Sesame, so it would be some work, though not a huge amount for me to fire up the espresso machine and re-enter the newest data. Undecided
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Search/Update subform from within parent form
Reply #10 - Apr 16th, 2007 at 10:04pm
Print Post Print Post  
Charlie,

Sorry for taking a while to get back to you.

It sounds likely that your application is not "corrupt", but does have data in the wrong elements due to the ASCII imports not "lining up" with order as exported, or from error presents in the original Q&A application. If you wish, we have tools here that can determine if what you are seeing is structural corruption or not.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Search/Update subform from within parent form
Reply #11 - Apr 17th, 2007 at 2:40am
Print Post Print Post  
Quote:
Charlie,

Sorry for taking a while to get back to you.

It sounds likely that your application is not "corrupt", but does have data in the wrong elements due to the ASCII imports not "lining up" with order as exported, or from error presents in the original Q&A application. If you wish, we have tools here that can determine if what you are seeing is structural corruption or not.


Looking back at my post, rather than my database being corrupt, I should have said that I think I may have imported some corrupt data from Q&A when I translated into Sesame.  I'm quite certain it has nothing to do with Sesame but rather some bad data I imported from Q&A.  The translation process went smoothly-no errors or glitches.  I noticed what appears to be "blank" records as well as the items I listed before when viewing the exported text file.

I did send my data files in to support for a different reason last Friday.  I can send again if need be.  Thanks for offering to look things over.  I'll be working on my end as well.  

I might add that our my Sesame program is running fine.  Searches are good, what elementary programming I have runs great.  I am curious as to how it will run when I change to natural linking:)  I have a very strong feeling it will speed things up considerably.  Thanks....*again*
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Search/Update subform from within parent form
Reply #12 - Apr 17th, 2007 at 3:02am
Print Post Print Post  
The blackout today (constant high winds swept NE Ohio) really gummed up the works. Tech support was still answering the phones (and the customers), but development was forced to take a breather. Tomorrow I'll ask Ray about your application and see if I can get it added to my inbox.

In Q&A, under the hood, everything is stored as ASCII strings. So if you could "see into" your running database, you would see a number or date portrayed as a human readable string of characters. This makes Q&A very (some would say "too") forgiving about data that doesn't match the specified field type. Sesame is "hard typed" - meaning that numbers, for example, are stored in binary format, not human readable. For the end user, that means if you put a first name in a field that is supposed to contain a number, Sesame will dutifully use the first 4 or 8 bytes of that first name as the binary value of that number. If you try to do this using a form, Sesame will complain that it cannot readily determine the value as a number. But in "mass" operations, like conversion from Q&A, having Sesame complain throughout the process that you have names where you ought to have numbers is reserved largely for the log file.

It is always wise to check the log file after a Q&A conversion to see if anything is out of place coming in from Q&A. It'll spare you a bit of grief if you catch unconvertable data early in the process.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Search/Update subform from within parent form
Reply #13 - Apr 17th, 2007 at 5:08am
Print Post Print Post  
The weather this year has been incredible...hope everyone is doing ok there...had high winds here, but nothing compared to the east.

I understand regarding the differences in the way Sesame and Q&A "see" data...one question that I popped into my mind was if it is necessary to have LE exported in the same order in both parent and subforms where they contain identical data-in my case I have Make, Model, Serial Number and several other LE that contain related data.
I just tried an expor/import again after cleaning out what questionable entries I could find...Inventory came back almost perfectly...subform records were almost double the number I had exported when the Import was complete.  Not sure if that is a "clue" as to what I may be doing wrong  Undecided

No rush on this Mark...we're operating and able to add and retrieve data here.  Just trying to make things as good as they can be in the long run.   Thanks for your help-take care of your priorities.  Power outages are no fun.
Charlie
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Search/Update subform from within parent form
Reply #14 - Apr 17th, 2007 at 5:29am
Print Post Print Post  
Actually ths storm that washed out Carl's street is part of the same storm that affected Hammer.  And we are still waiting for that section to hit us soon.  Also, Carl's town made the 11 o'clock news for flood problems.  About 20 miles from me.

Curious about the double number of subform records......
Did you delete the sub form records after export, but before import?
Deleting the parents does not delete the children, you may have duplicate subform records for each parent.
If you did not delete the parents, do you have two of each parent also?
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print