Normal Topic New record in an external Databas (Read 1190 times)
nelsona
Member
*
Offline


No personal text

Posts: 10
Joined: Jan 10th, 2006
New record in an external Databas
Feb 1st, 2006 at 5:09pm
Print Post Print Post  
I've been looking around and I cant seem to find a solution;
I'm trying to create a new record in an external database
(archive.db for example) so that I can take the current record and xpost it to archive.db and keep my main db lean

this is for a payroll db where it would bloat very quickly; archives need to be kept but are accessed rarely so I would like to keep the payroll db small and for calculations, etc only

is this possible or am I looking at this the wrong way??


thanks abunch,

Alan
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: New record in an external Databas
Reply #1 - Feb 2nd, 2006 at 3:07am
Print Post Print Post  
Sesame has CreateNewRecord(), but that only works for the current open form, so that won't help you here.

There's a technique that I used in Q&A for years. Maybe you can adapt it to be used in Sesame. It involves using a batch file to create a bunch of records that are blank, except for the key field, which is given the value of "Free". This way, I can simply xpost using the external key value of "Free", and the xpost will use any one of the many semi-blank records that are available. During the xpost the "Free" value gets overwritten with a real key value from the data that I am posting (e.g. an invoice number).

If the xpost failed to find an available record to post to, there is an automated routine that launched a 2nd copy of Q&A that would rerun the macro, and create 30 more "Free" records.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
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: New record in an external Databas
Reply #2 - Feb 2nd, 2006 at 5:22am
Print Post Print Post  
How about writing the new record data out to an ascii file.  then run a macro that opens the other database and does an import of the ascii file.

The macro would open a copy of Sesame.   The Application Program could look for the ascii file, and if it exists, could run the import process and close.  This would also eliminate the need to do xposting to a blank record.
  



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


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: New record in an external Databas
Reply #3 - Feb 2nd, 2006 at 12:22pm
Print Post Print Post  
Hello carl,

did CreateNewRecord() olso works for the current open form and subform ?


  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: New record in an external Databas
Reply #4 - Feb 2nd, 2006 at 12:52pm
Print Post Print Post  
Hello carl,

did CreateNewRecord() olso works for the current open form and subform ?


  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: New record in an external Databas
Reply #5 - Feb 2nd, 2006 at 5:14pm
Print Post Print Post  
I have discovered that CreateNewRecord() was renamed to @CreateNewRecord(). The Sesame Programming Guide needs updating.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: New record in an external Databas
Reply #6 - Feb 2nd, 2006 at 5:15pm
Print Post Print Post  
Quote:
Hello carl,

did CreateNewRecord() olso works for the current open form and subform ?

If I understand your question correctly, I would say yes.

  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: New record in an external Databas
Reply #7 - Feb 2nd, 2006 at 6:27pm
Print Post Print Post  
Hello carl,

can i use @createNewRecord() from the main Form to create a new record in the Subform?
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: New record in an external Databas
Reply #8 - Feb 2nd, 2006 at 8:57pm
Print Post Print Post  
Ah ha! Now I know what you mean. Smiley

No, @CreateNewRecord() will not make a new subform record. But, @FormNewRecord("MySubform") will do it.

When I needed to add a subform record, I had a difficult time trying to find a function that would do that - mostly because it is named @FormNewRecord. I was searching the PDF files for "Create", which of course, didn't find what I was looking for.

Mark informed me of the correct function for this purpose. You can see the details at this link:
http://www.lantica.com/Forum2/cgi-bin/yabb/YaBB.pl?board=gen_disc;action=display...
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged