Normal Topic please help me with a basic command xlookup (Read 1052 times)
georg_mim
Member
*
Offline


No personal text

Posts: 1
Joined: Jan 29th, 2004
please help me with a basic command xlookup
Jan 29th, 2004 at 4:32pm
Print Post Print Post  

can someone tell me where I go wrong becuase when I input instead of the info appearing the field goes blank? am still to used to Q&A but can't get my head around the xlookup functions with sesam  ???

I have two files
1.db
2.db

I need the info from 1.db to appear in 2.db
1.db has the following fields:
Number
Name
Adress

2db has
number
and I want name and adress to appear when I input the number.

this is the command string I have

element is number - upon form change

xlu ("1.db", number, "number", "name", name)


Please someone help me with this!

  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: please help me with a basic command xlookup
Reply #1 - Jan 29th, 2004 at 4:47pm
Print Post Print Post  
georg_mim,

I think it is best to give your command the complete path.

example

Xlookup("C:\Sesame\Data\1.db", number, "number", "name", name)

Using Xlooup in Sesame we need to specify Xlookup for each  element.

Xlookup("C:\Sesame\Data\1.db", number, "number", "name", name) // enters name
Xlookup("C:\Sesame\Data\1.db", number, "number", "zip", zip) // enters zip

Check out the explanation starting on page 125 in the programming manual. see the examples on pg 127

I hope this helps
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: please help me with a basic command xlookup
Reply #2 - Jan 29th, 2004 at 4:49pm
Print Post Print Post  
Have you tried using a full path to the lookup database? For example:

xlu ("C:\Sesame\Data\1.db", number, "number", "name", name)

Of course, replace: "C:\Sesame\Data\" with the actual path to your .db file.

To avoid having XLookup blank your field if it returns either a blank value or an error, use a variable:

var v_tmp as string

v_tmp = @xlu("C:\MyDir\MyDb.db", number, "number", "name")
if(v_tmp <> "")
{
   name = v_tmp
}
  

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


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: please help me with a basic command xlookup
Reply #3 - Jan 29th, 2004 at 5:25pm
Print Post Print Post  
Quote:
To avoid having XLookup blank your field if it returns either a blank value or an error, use a variable:

var v_tmp as string

v_tmp = @xlu("C:\MyDir\MyDb.db", number, "number", "name")
if(v_tmp <> "") 
{
   name = v_tmp
}



Is not that the difference between @xlu and xlu?
@xlu will blank out the field if it did not find the value while xlu will retain the value of the element in that case (in case of error or no value) when you are trying to assign new value.

However, your method is also useful if one decides to use @xlu and wants to have the same result as that of xlu.  Thank you.
  
Back to top
 
IP Logged