Hot Topic (More than 10 Replies) Exporting/importing (Read 1117 times)
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Exporting/importing
Oct 17th, 2007 at 3:44pm
Print Post Print Post  
Sesame 1.1.4

I've finally taken time to get back to making some design changes...I'm doing something not quite right is my theory.  I wanted to redesign my subform so that the linking is natural rather than relational in hopes it would be more efficient.  There are 6000 + records in the subform and it increases daily. I exported my records, changed the subform properties, imported the data back in to Sesame and find I'm missing 2000 or so subform records...and my programming is running wierd...I have programmed a running total for subform records and it calculates, but the total stays in the element for only a fraction of a second...then it's blank.
My main concern (first things first) is to find out why I have records missing after importing back in to Sesame.  I was VERY careful to check for blank records prior to export...also careful about the order in which I exported and imported.

I'm wondering if I should export each database seperately rather than together as parent and child records?  I think Ray and I discussed this awhile back and I've just gotten time to work on it again.

BTW, as is stands linked relationally, everything runs fine though searches are very slow when Sesame has to search through thousands of records, etc.  

I'm thinking of a few different ways I might be able to acomplish what I want which involve importing into Q&A, re-translating, etc...which I can do if need be.

Any ideas appreciated. Undecided
  
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: Exporting/importing
Reply #1 - Oct 17th, 2007 at 3:53pm
Print Post Print Post  
Were the 2,000 records that don't appear parented to your main form? If they were not, the records would not have shown up when you ran your original hierarchical export and would not be exported.
  
Back to top
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Exporting/importing
Reply #2 - Oct 17th, 2007 at 4:03pm
Print Post Print Post  
Quote:
Were the 2,000 records that don't appear parented to your main form? If they were not, the records would not have shown up when you ran your original hierarchical export and would not be exported.


Hello again Ben,

Yes they were parented to my main form.  I made a note of the number of records I have in each dadabase prior to exporting.  The parent records came back perfectly.  I think it's something I'm doing/not doing with my subform records.  I haven' yet tried to export form each database in stand - alone mode.  Is that recommended when I would be importing back into the same application?  I know there are probably severa different ways to accomplish this.  I'm looking for the most correct one Wink
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Exporting/importing
Reply #3 - Oct 17th, 2007 at 4:30pm
Print Post Print Post  
Hello Charlie,

What Ben was meaning to say is are those 2,000 records actually parented to a Parent Record? Here is what can happen, and may be happening in your case.

Parent Form - 10 Records with 2 subrecords each so 20 Parented Subrecords
Subform - 30 Records

The subform itself has 10 records that do not have a parent so when you export data from the parent form those 10 records are not exported. Only the 20 subrecords that are displayed on the 10 parent records are exported out to the txt file and so they are the only ones imported back in.

As for your programming running oddly, Is there any other event that sets the value of the Total element on the subform?

Also if you are using 1.1.4, I would recommend updating to version 1.1.5A as it has some changes in it that you may need.

-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: Exporting/importing
Reply #4 - Oct 17th, 2007 at 7:31pm
Print Post Print Post  
Quote:
Hello Charlie,

What Ben was meaning to say is are those 2,000 records actually parented to a Parent Record? Here is what can happen, and may be happening in your case.

Parent Form - 10 Records with 2 subrecords each so 20 Parented Subrecords
Subform - 30 Records

The subform itself has 10 records that do not have a parent so when you export data from the parent form those 10 records are not exported. Only the 20 subrecords that are displayed on the 10 parent records are exported out to the txt file and so they are the only ones imported back in.

As for your programming running oddly, Is there any other event that sets the value of the Total element on the subform?

Also if you are using 1.1.4, I would recommend updating to version 1.1.5A as it has some changes in it that you may need.

-Ray


Ray,

Programming runs on Form Exit: 

Code:
CalculateParts()

Here's the Global Code:

SubRoutine CalculateParts()   
 
Var vCount as Int   
Var vTotal as Double   
Var vRecord as Int   
 
 
vRecord = 1 //Record variable   
 
vCount = @FormResultSetTotal("Repair1")   


If vCount > 0 Then   
{   
While vRecord <= vCount   
{   
//Loop through subrecords adding up totals.   
vTotal = vTotal + @TM(@FormFieldValue("Repair1", "Parts", vRecord))   

vRecord = vRecord + 1   
}   
 
//Place values in elements on form   
RepairTotal = vTotal   
}   

End SubRoutine
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Exporting/importing
Reply #5 - Oct 18th, 2007 at 2:31pm
Print Post Print Post  
Hello Charlie,

If you can could you send in a copy of your application that is showing the RepairTotal being cleared out after being filled in. DB and DAT or DSR and DDT either or will work as long as they show this problem.

-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: Exporting/importing
Reply #6 - Oct 18th, 2007 at 3:55pm
Print Post Print Post  
Quote:
Hello Charlie,

If you can could you send in a copy of your application that is showing the RepairTotal being cleared out after being filled in. DB and DAT or DSR and DDT either or will work as long as they show this problem.

-Ray


I'll do that Ray...the code is working perfectly on my original application.  When I exported, redesigned with natural linking and imported my records back into the application is when this little problem appeared.  I'll get those files together asap.  Thank you.
  
Back to top
 
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Exporting/importing
Reply #7 - Oct 19th, 2007 at 3:50pm
Print Post Print Post  
Quote:
Hello Charlie,

If you can could you send in a copy of your application that is showing the RepairTotal being cleared out after being filled in. DB and DAT or DSR and DDT either or will work as long as they show this problem.

-Ray


Ray,

If it's ok, I'll also send in the exported ascii file that I used after redesigning my application.

BTW, I'm working at home, so this will come in through my home email address.
  
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: Exporting/importing
Reply #8 - Oct 19th, 2007 at 5:55pm
Print Post Print Post  
Quote:
...showing the RepairTotal being cleared out after being filled in. DB and DAT or DSR and DDT either or will work as long as they show this problem.


Charlie,

The element used to display the total was not bound to a field. So in essence, your programming was filling in the element and then throwing that value away because it had nowhere to store it.
  
Back to top
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Exporting/importing
Reply #9 - Oct 19th, 2007 at 10:24pm
Print Post Print Post  
Quote:
Quote:
...showing the RepairTotal being cleared out after being filled in. DB and DAT or DSR and DDT either or will work as long as they show this problem.


Charlie,

The element used to display the total was not bound to a field. So in essence, your programming was filling in the element and then throwing that value away because it had nowhere to store it.



Embarrassed  Makes perfect sense...thank you Ben.  I'm working with copies of everything, so I'll go back and try a few other things while I take care of that problem.  Have a great weekend Ben-thanks again.
  
Back to top
 
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Exporting/importing
Reply #10 - Oct 19th, 2007 at 11:02pm
Print Post Print Post  
Quote:
Were the 2,000 records that don't appear parented to your main form? If they were not, the records would not have shown up when you ran your original hierarchical export and would not be exported.


Ben,
A light bulb lit above my head a few minutes ago (dim as it may be).

I re-read what you and Ray were saying about those "missing" records...jogging my memory back about 7 years or so I realized that we have been repairing and keeping repair records on equipment from other departments that we do NOT have on our inventory.  There is no inventory record (parent) for some of our repair records; how many? maybe 2,000?   Undecided

I'll do some reading and see if there is a way (using our original application-or even our old Q&A database) to find these records.  I'm certain you've hit the nail on the head Ben... Wink  I'll make a list of those departments and see if I can get a total on the nember of those records by a simple search through our database prior to exporting.  Thank you Ben...and, of course, "the one and the only"  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: Exporting/importing
Reply #11 - Oct 21st, 2007 at 6:22pm
Print Post Print Post  
My problem on exporting/importing has been orphan records all along...I hadn't realized that there were many repairs entered in our Q&A database that were not items on our inventory....nothing to link to in the parent, so these "kids" are wandering aimlessly about.

I have two versions of our application saved-thanks to Ben and Ray-many thanks btw  Smiley-one relationally linked, one naturally linked.  It's a matter of whether we can do without those orphans or put them on our inventory to make things right.  I'll discuss that with the boss on Monday.  I may be able to just print out a report or import those records to a seperate database for safe-keeping.


  
Back to top
 
IP Logged