Hot Topic (More than 10 Replies) Can I Create a new record in external DB? (Read 1599 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Can I Create a new record in external DB?
Jul 7th, 2005 at 11:26pm
Print Post Print Post  
We're looking to create a new record and 'xpost' data into the new record without having the DB opened.

Is this possible?

Thanks,
Steve
  
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: Can I Create a new record in external DB?
Reply #1 - Jul 8th, 2005 at 3:53am
Print Post Print Post  
You should be able to XPost to another database while it is closed in the same application, but I am not sure what will happen if going to a database in a different application that is closed.

Sometimes the best way to answer questions like this is to try it if you think you can reverse what might happen.  A situation like this should be reversible, try it and see what happens.  Let us know the results.

  



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


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Can I Create a new record in external DB?
Reply #2 - Jul 8th, 2005 at 3:58am
Print Post Print Post  
Bob,

The part I'm stuck on is how to 'create' a new record in the external database in order to 'receive' the xposting.
(Once the new record is created, I should be able to Xpost to it just fine.)

Maybe I'm missing something very obvious?

Thanks for your feedback.

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



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Can I Create a new record in external DB?
Reply #3 - Jul 10th, 2005 at 6:12pm
Print Post Print Post  
Quote:
The part I'm stuck on is how to 'create' a new record in the external database in order to 'receive' the xposting.

Steve,

I'm not sure about creating a new record in a closed DB. But, I needed to do something similar with Q&A.

The way I worked around it was to use a macro to create many records at once with the text "FREE" in the key field. Then I would simply xpost using the key value of "FREE" to find one of those available records, replacing "FREE" in the target record with a new key value from the source record. You then have a record with you can xpost the rest of the data to.

If there were no "FREE" records found to post to, that's when the macro kicked in to create some.
  


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: Can I Create a new record in external DB?
Reply #4 - Jul 10th, 2005 at 10:37pm
Print Post Print Post  
I haven't tried this yet, but can you use @FormNewRecord(formname) by puttng in the full path of the desired form like this:

@FormNewRecord(@Application+"!DatabaseName!FormName")

« Last Edit: Jul 12th, 2005 at 12:50am by Bob_Hansen »  



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


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Can I Create a new record in external DB?
Reply #5 - Jul 11th, 2005 at 10:52pm
Print Post Print Post  
Carl,

Your creative solution would probably work for me, but I was hoping for something that would require less work.

Bob,

Your idea is exactly what I was hoping to find. I'll try it out and report back as to the results. By the way, how would one know about this option. Is this documented in the manual and I overlooked it?

Thanks for everyone's assistance.

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



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Can I Create a new record in external DB?
Reply #6 - Jul 12th, 2005 at 12:15am
Print Post Print Post  
Re: FormNewRecord(@Application+"!DatabaseName!FormName")
Quote:
Is this documented in the manual and I overlooked it?

I haven't found it either. Probably because it doesn't exist. Wink

I think Bob is using the "wishful thinking" part of his brain. Grin  (Sorry Bob, I couldn't resist.)

Though I admit, it would be a great feature for a future release.

PS: I'm assuming it doesn't work that way since it's not in the manual. I haven't tried to make it work myself.

  


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: Can I Create a new record in external DB?
Reply #7 - Jul 12th, 2005 at 12:48am
Print Post Print Post  
Quote:
I haven't found it either. Probably because it doesn't exist.

I think Bob is using the "wishful thinking" part of his brain.  (Sorry Bob, I couldn't resist.)

Wrong this time Carl ??? Very unusual.....

See @FormNewRecord(form) on page 173, Programming Guide.

  



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



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Can I Create a new record in external DB?
Reply #8 - Jul 12th, 2005 at 1:07am
Print Post Print Post  
Bob,

Sorry about the confusion. I didn't mean that the function didn't exist, I meant that I didn't see where you could use the application name to create a new record in a closed DB.
  


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: Can I Create a new record in external DB?
Reply #9 - Jul 12th, 2005 at 2:36am
Print Post Print Post  
Using @Application would be for a form in the same open application.  To do this in a closed application we would need to do something like @FormNewRecord("C:\Sesame\Data\Application.db!DatabaseName!FormName")

It may be possible to create a record in a closed database.  I know you can add records to closed Access databases and you can modify cells in Excel using DDE technology.

Other programs can be modified using SQL commands on closed databases, so maybe we can do this in Sesame also.  I may be able to try this out next weekend.





  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Can I Create a new record in external DB?
Reply #10 - Jul 12th, 2005 at 1:51pm
Print Post Print Post  
You cannot currently create a new record in a database unless you have a Form open that displays records from that database. Tacking on the Application name to FormNewRecord is not going to work. No command that does not have an X in front of it can affect an external database.

The ability to operate directly on external database records (adding, editing, deleting, counting, etc.) will be available in the next major version.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Can I Create a new record in external DB?
Reply #11 - Jul 12th, 2005 at 1:56pm
Print Post Print Post  
Sesame has the ability to record exiting File->Exit as part of a macro. That allows you to record a macro that creates the new record, tags a field, and then exits the program. You can then invoke Sesame from an @Shell command or @ASynchShell (if you have the association set up):

sesame -macro MacroName.mac ApplicationName.db

That will open the app in Sesame, create the new record, and then exit Sesame. In general, having the ability to record an "exit program" event, allows Sesame to be a good background batch processor.
  

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


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Can I Create a new record in external DB?
Reply #12 - Jul 13th, 2005 at 2:32am
Print Post Print Post  
Thanks for everyone's input. I was hoping to be able to create an invoice in an external database from within an Orders application.

I may opt for the file I/O commands to create the invoices in a csv file, then use a sesame form to display/import/print them, as needed.

Thanks again for all the options.

Steve

  
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: Can I Create a new record in external DB?
Reply #13 - Jul 13th, 2005 at 5:09am
Print Post Print Post  
Quote:
The ability to operate directly on external database records (adding, editing, deleting, counting, etc.) will be available in the next major version.
That is great!  You folks are too good. 

And thanks for letting me know I don't have to test this on the weekend.
  



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