Hot Topic (More than 10 Replies) pulling information between databases (Read 1483 times)
Kerinst
Member
*
Offline


If you can't do it right
lemme do it wrong for
you

Posts: 32
Location: North Dakota
Joined: Jun 3rd, 2004
pulling information between databases
Jul 8th, 2004 at 6:41pm
Print Post Print Post  
Hello, I was wondering if somebody could give me a usable explaination about using x whatever to work between multiple databases... I've been trying to learn this part to use it but I don't seem to be getting it right...
  
Back to top
 
IP Logged
 
JFisher
Junior Member
**
Offline


No personal text

Posts: 51
Location: Roswell, NM
Joined: Jan 7th, 2004
Re: pulling information between databases
Reply #1 - Jul 8th, 2004 at 9:15pm
Print Post Print Post  
If by "...using x whatever..." you mean the XLookup family of commands to transfer information from one database to another, you could carefully review Pages 124-138 of the Programming Guide.  Also there is a nice explanation of XLookup in the April Inside Sesame issue, page 1.

I have found both of these sources useful in my Personnel and Payroll applications.  (My programs were previously written in Q&A)

Hope this helps.

Jack
  
Back to top
 
IP Logged
 
beagle
Junior Member
**
Offline


No personal text

Posts: 80
Location: australia
Joined: May 28th, 2004
Re: pulling information between databases
Reply #2 - Jul 8th, 2004 at 10:32pm
Print Post Print Post  
Hi,

Just watch out x..... commands DO NOT work in preview mode.

The examples in the book are quite good.

Also I have found that XuserselectR commands do not work if you have security applied to your application - (i dont know if this affects other x... commands,this should be fixed in the next update of the program.

good luck
  
Back to top
 
IP Logged
 
GW
Junior Member
**
Offline


No personal text

Posts: 83
Joined: Dec 16th, 2003
Re: pulling information between databases
Reply #3 - Jul 9th, 2004 at 2:54am
Print Post Print Post  
Can someone tell me whats wrong with the following @XLU command

Amount = @XLU("Data\Testbase2.db",Code,"Price Data!Code","Purchase_Price") * Qty

I get a "Type Mismatch Error" on the *
If I change the * to a + it works. If I delete the * Qty it works
This worked in Q&A so I figure I missed something in the translation.
thanx
  
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: pulling information between databases
Reply #4 - Jul 9th, 2004 at 6:45am
Print Post Print Post  
Hi Becky...

The Purchase_Price that is returned from the XLU is actually a String and cannot do math.  You need to convert the XLU string into a number like this: Quote:
Amount = @ToNumber(@XLU("Data\Testbase2.db",Code,"Price Data!Code","Purchase_Price"))* Qty


You will have to make similar modifications to any XLU statements that were translated from Q&A for fields that you consider as non-strings(numbers, dates, etc.).

The conversion functions to consider are: @ToDate, @ToMoney, @ToNumber, @ToTime, @ToYesNo.  (Shortcut names: @TD, @TM, @TN, @TT, @TY respectively).
  



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


If you can't do it right
lemme do it wrong for
you

Posts: 32
Location: North Dakota
Joined: Jun 3rd, 2004
Re: pulling information between databases
Reply #5 - Jul 9th, 2004 at 12:44pm
Print Post Print Post  
OK I'll read those pages again  Smiley  I am still very green at programming but I'm trying  Cheesy
  
Back to top
 
IP Logged
 
GW
Junior Member
**
Offline


No personal text

Posts: 83
Joined: Dec 16th, 2003
Re: pulling information between databases
Reply #6 - Jul 9th, 2004 at 12:54pm
Print Post Print Post  
Thanks Bob,
Now that you turned the light on I remember reading on the use of typecast functions.
that also took care of another nagging problem from Q&A.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: pulling information between databases
Reply #7 - Jul 16th, 2004 at 7:52pm
Print Post Print Post  
My @Xlookup statement didn't work after I added Security. After I removed security, it started working. Angry

I'm still having a hard time with the following xlookupsourcelistall, but i'll keep trying:

var a as string

a=@XLookupSourceListAll(@fn, stock nu, "variants!stock nu","variant name;retail;le0;sale;cost")

writeln(a)

Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: pulling information between databases
Reply #8 - Jul 16th, 2004 at 8:04pm
Print Post Print Post  
Quote:
My @Xlookup statement didn't work after I added Security. After I removed security, it started working. Angry


It's so weird how the bugs come in clusters. Somebody else just reported the security/XCommand bug. We just fixed this.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: pulling information between databases
Reply #9 - Jul 16th, 2004 at 8:18pm
Print Post Print Post  
Erika,

Any idea why my xlookupsourcelistall isnt working? I've tried several different options but it keeps returning an error (using runtime, not preview, ver 1.0.4).

I'm trying to lookup data from a different database (variants) in the same application. The names I'm using above are field names, not LE labels. Some of the LE's have been deleted, but the fields still exist in the db.

Your help is appreciated.

Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: pulling information between databases
Reply #10 - Jul 16th, 2004 at 8:43pm
Print Post Print Post  
You should be using LE names, not field names. If the LE's have been deleted, Sesame will have no way of knowing what field they used to be bound to and, therefore, will not be able to get the data from that field. You cannot do X Commands on fields that have no LE's bound to them. The LE is the "window" on the field.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: pulling information between databases
Reply #11 - Jul 16th, 2004 at 8:58pm
Print Post Print Post  
Thanks! You fixed it for me!

Again!

Steve
  
Back to top
IP Logged