Very Hot Topic (More than 25 Replies) Relational / Combo-Box Programming help? (Read 5337 times)
NWade
Member
*
Offline


No personal text

Posts: 3
Joined: Jul 7th, 2004
Relational / Combo-Box Programming help?
Jul 7th, 2004 at 3:02am
Print Post Print Post  
Okay all,

I'm brand new to Sesame - am having to work on it for a client; but I've been a PHP/mySQL and MS-SQL junkie for the last 2 years...  So SBASIC is all new to me, and I'm having to mentally re-adjust to the limited access and methods that Sesame uses to access the DB.

I'm trying to implement something that SHOULD be possible, but I'm not sure what the best method is to implement it...  I have a Database of family members, and I want to create what I would term in SQL as a "foreign key" relationship between records.  Tips, suggestions, or advice are certainly appreciated!

Basically, I have a numeric field "personID" to uniquely identify each person/record (a "primary key" in SQL terms).  I also have the field "fatherID" - the idea being that this field will refer to an existing "personID" record if that person's father is already in the database, so that parent/child relationships can be tracked.

However, I don't want to require the users to remember the actual ID numbers - so I was hoping to display a list-box or combo-box in the form, and have it populate (On Form Entry) with the names of all of the males currently in the database.  When a selection is made, the ID number of that person could be stored in the "fatherID" field; and on future viewings, the name of the selected "father" could be automatically retrieved and displayed on the form.

Of course, the first issue is that the combo-box needs to display text information (the potential father names), while the value to be saved is numeric.  Maybe I'm spoiled, but in HTML forms you can have combo/list-box items display one thing, but their actual value be something else entirely (i.e. a "key-value" pair).  I can't see a way at the moment (except perhaps with a static array or something??) to retrieve the values from 2 columns of a database at once, and keep them associated with each other while the user selects one.  They need to stay associated to guarantee that the proper ID number is recorded - (i.e. going back and looking up the father's name to retrieve his personID from the database after selecting him is not acceptable, as the names themselves are not going to be guaranteed to be unique).

Any thoughts, comments, concerns?  I see a couple of possible ways of doing it; but I'm hoping your suggestions will point to a clearer or less-cumbersome solution than what I'm envisioning...

Thanks, take care,

--Noel
noel_wade@hotmail.com
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #1 - Jul 7th, 2004 at 11:28am
Print Post Print Post  
I'm not sure how literal you are being when referring to "parent" IDs and etc... but you may want to reconsider using relational linking unless it is absolutely necessary. The occassion in which relational linking is warranted in Sesame (as opposed to natural linking) is where a single child that is unique (and must remain "normalized") appears under multiple differing parents. Otherwise use natural linking. It is much simpler and faster.

Unlike MySql, Sesame is not dividing your database into multiple standalone tables. Instead, it uses a variation of an outline (lists within lists) to maintain hierarchy.

To create a combo box that shows one value and returns another, use an unbound combo box. Then use the "GlobalValue" functions to populate the combo box and "match" a string to a numeric to generate the key value. GlobalValues are tables of values stored with the database that are "keyed" off of an arbitrary string.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #2 - Jul 7th, 2004 at 11:35am
Print Post Print Post  
If your name/number pairs are coming out of database records (as opposed to being static lists) you can use commands like XLookupSourceListAll to create a composite value for your combo box or picklist and parse the number off the selected value.
  

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


No personal text

Posts: 3
Joined: Jul 7th, 2004
Re: Relational / Combo-Box Programming help?
Reply #3 - Jul 7th, 2004 at 6:10pm
Print Post Print Post  
Mark -

Thanks for the advice... However, since these records are all part of the same DB, I can't make them "natural" parent/child records.  Plus, I am looking to have both "fatherID" and "motherID" fields (I left out "motherID" to simplify my example), so that full lineage and bloodlines may be tracked for a medical study.  FYI: I have medical history records that are "natural" children of each person's main record, to track each major health issue as a seperate record...  So I'm already using "natural" linking in the app. Wink


Hammer -

That was one avenue I was pursuing, but I didn't know how to retrieve multiple fields at once.  Where is "XLookupSourceListAll" documented?  I can't find it in the Sesame Programming Guide... at least, not in the table on pg. 38 nor in the "Retrieving Data" or "Advanced Functions" sections.

Which triggers a thought:  Has the Lantica team considered posting an SBASIC "API reference" on the website?  One of the nice things about mySQL.com and PHP.net are that they have complete lists of keywords and built-in functions on their websites...  I don't see that on the Lantica website or on sesamedatabase.com, but correct me if its there and I'm blind! ;-P

Thanks a bunch, take care,

--Noel
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #4 - Jul 7th, 2004 at 6:24pm
Print Post Print Post  
It is one of the new commands added in a recent update. Everything added since the original release is contained in a Documentation Supplement that is available in the same place you go to download the program updates. Take a look at the new X commands, and also the StringArray functions, whcih are very handy for operating on the values returned by the X commands.  Smiley

For a brief summary of the new commands, take a look at the Change Log.

You may want to consider looking into the Inside Sesame newsletter. I know that recent issues have included some articles on different ways to generate and work with picklists and combo boxes.
  

- 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: Relational / Combo-Box Programming help?
Reply #5 - Jul 21st, 2004 at 6:39pm
Print Post Print Post  
Is it possible to auto-populate a combo box with a string of results built from an xlookup command, while STRIPPING OUT dupes and alphebetizing, or can this only be done with the popup menu command?

We prefer to use combo boxes because they are neat, clean, easy to use, and we can control the placement, size and color of the box and list.

Also, we NEED the 'auto complete' properties of a combo box rather than having to hunt through a large list of choices.

Am I overlooking something obvious?

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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #6 - Jul 21st, 2004 at 6:57pm
Print Post Print Post  
Quote:
Is it possible to auto-populate a combo box with a string of results built from an xlookup command, while STRIPPING OUT dupes and alphebetizing, or can this only be done with the popup menu command?


@XLookupAll will return a semicolon separated list of values. @SortStringArray can sort the list. PopulateListElement can hand the list to a combo box. You'll have to use the string array functions to create a custom duplicate stripping routine.

  

- 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: Relational / Combo-Box Programming help?
Reply #7 - Jul 21st, 2004 at 6:59pm
Print Post Print Post  
Thanks for the tips!

I'll head off in that direction!

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #8 - Jul 22nd, 2004 at 10:01pm
Print Post Print Post  
Erika,

I've got the programming done and I will post it in the programming examples section of this forum, but I have 1 more issue.

Combo box's dont seem to follow the traditional  'programming events' rules. On Element Entry and On Element Exit dont do anything. I THINK I could only get the program to fire when I used On Element Immediate change.

My programming works fine if I put it in a command button.

Is this documented somewhere in the manual, or is this a bug?

The below program was pasted in LE named MFGR On Element Exit:

var vduped as string
var vstring as string
var vcollections as string
var vcollection as string


if @mode() = 2 and mfgr <> "" then
{
vcollections = @XLookUpAll(@FN, mfgr, "mfgr", "collection")
vduped = @sortstringarray(vcollections, 0)

while @len(vduped)>0
{
if @instr(vduped, ";")>0 then vstring=split(vduped, ";") else vstring = split(vduped, @newline())
if @instr(vcollection, vstring)<1 then vcollection = vcollection + vstring + ";"
vstring = ""
}
populatelistelement(collection, vcollection)
}

Edit: MFGR and Collection are both Combo Boxes.
Edit again: Program does not work in MFGR On Immediate Change, either.

Thanks for the help!

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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #9 - Jul 23rd, 2004 at 12:23pm
Print Post Print Post  
Steve,

Both OnEntry and OnExit programs are triggering for me on a combo box. We did fix a small issue a few days ago where OnChange did not refresh immediately under certain circumstances, but OnEntry and OnExit seem to be doing fine.

Try just putting a WriteLn in the event to see if it's running at all. Perhaps your conditions are not occuring as you think they are.
  

- 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: Relational / Combo-Box Programming help?
Reply #10 - Jul 23rd, 2004 at 1:29pm
Print Post Print Post  
I had at least 5 writelns in the program until I got it to work with a button. With a button, it works flawlessly.

I then pasted the same program into the combo box, in serveral different events, but no luck.

In particular (and maybe the only issue) is the second combo box is not supposed to fire unless the first combo box is not blank.

Is it possible the second combo box cannot tell if the first combo box is filled in? (a bug?)


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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #11 - Jul 23rd, 2004 at 1:37pm
Print Post Print Post  
Steve,

You're telling me that you don't think the OnEntry and OnExit events are running for the combo box. I'm suggesting that you put nothing but a WriteLn in the event, just to see if it is running at all. If the event runs, but your particular code is not doing what you think it should, then you may not be meeting the conditions in your code.

If the button can tell that a combo box is blank, then so can another combo box. It is actaully the programming environment checking this, not any particular element.
  

- 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: Relational / Combo-Box Programming help?
Reply #12 - Jul 23rd, 2004 at 1:46pm
Print Post Print Post  
Oh, good point. I just added writelns to the combo box on element exit and on element entry and tested it in preview mode.

the results........NOTHING!

Just for kicks I pressed the button to do the xlookups and populatelistelement. The results.....CRASH!

I'm restarting the server now becuase Sunlock wont unlock the dsr.

I guess thats what I get for trying to do an xlookup in preview mode.

Steve

edit: restarted sesame server and tried to open DSR file.

ERROR: Database does not exist.

Go figure!
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #13 - Jul 23rd, 2004 at 2:36pm
Print Post Print Post  
OK. After restoring a backup and redoing some programming, I tested all the element events for my two combo boxes. Here are the results:

"On Element Change" fires after changing AND exiting the LE.

On Element Entry does nothing
On Element Exit does nothing
On element Immeditate change does nothing


Results are the same for both of my combo boxes. This explains why my populatelistelements were not working.

Any ideas?

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #14 - Jul 23rd, 2004 at 3:03pm
Print Post Print Post  
Erika,

I see whats happening now.

in Update mode, my combo boxes seem to be working fine.

I was testing my program in Search(retrieve spec) mode.

I put my programming in On Element Change and it is working fine for me, but as mentioned before, it wont work in the other modes AS LONG AS IM IN SEARCH MODE.

Is this the correct functionality?

Sorry for the trouble.
Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #15 - Jul 23rd, 2004 at 3:45pm
Print Post Print Post  
I have to either restart Sesame Server, or recover from a backup when this program fires in Preview mode.
(This is in MFGR On Element Change. Crash occurs when I exit MFGR LE)

var vduped as string
var vstring as string
var vcollections as string
var vcollection as string

//writeln("MFGR On ELEMENT CHANGE now firing. Now populating Collection box.")

if @mode() = 2 and mfgr <> "" then
{
vcollections = @XLookUpAll(@FN, mfgr, "mfgr", "collection")
vduped = @sortstringarray(vcollections, 0)

while @len(vduped)>0
{
if @instr(vduped, ";")>0 then vstring=split(vduped, ";") else vstring = split(vduped, @newline())
if @instr(vcollection, vstring)<1 then vcollection = vcollection + vstring + ";"
vstring = ""
}
populatelistelement(collection, vcollection)
}



Seems like I need a way to only run the program if NOT in Preview mode. It works fine in runtime.

Sorry for all the trouble, but auto populating a combo box is turning out to be a fantastic feature! Next best thing to sliced bread.

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #16 - Jul 23rd, 2004 at 4:00pm
Print Post Print Post  
OK. I added:

if xmfgrs <> "" then    //If the lookup worked, then...
{
program....
}

so if the xlookup fails in preview, then the program will Stop. (prevents the crash in preview)

Sorry for all the trouble. Its looking good so far!
Smiley
Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #17 - Jul 23rd, 2004 at 4:44pm
Print Post Print Post  
We'll look at preventing an actual crash in Preview here also.
  

- 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: Relational / Combo-Box Programming help?
Reply #18 - Jul 23rd, 2004 at 5:44pm
Print Post Print Post  
That would be a nice thing!

Are the combo boxes working correctly, then? Is nothing supposed to happen while in search mode (except On element Change)

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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #19 - Jul 23rd, 2004 at 5:53pm
Print Post Print Post  
There are only two kinds of code that will run in a Retrieve Spec.
1. Code placed in On Retrieve Spec Open events
2. Code in the OnElementEntry event of a command button

As far as I can see, combo boxes are working correctly. If you were on a Retrieve Spec, you would have seen the symptoms you describe, where the code would run from a command button, but nowhere else. I didn't realize that you were on a Retrieve Spec. I saw the @Mode condition, but it didn't click that you were on a Retrieve Spec.
  

- 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: Relational / Combo-Box Programming help?
Reply #20 - Jul 23rd, 2004 at 5:59pm
Print Post Print Post  
Thanks Erika.

Thats important info to know. If it's in the manual, then I skipped right over it.

Thanks for all your help! If you dont' object, I'll post this to the Programming Examples board this weekend. (Although it won't be a polished and efficient as the other examples).

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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #21 - Jul 23rd, 2004 at 6:35pm
Print Post Print Post  
Quote:
Thanks Erika.

Thats important info to know. If it's in the manual, then I skipped right over it.


It's in the Supplement in the section that talks about the new On Retrieve Spec Open event. Page 8.
  

- 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: Relational / Combo-Box Programming help?
Reply #22 - Jul 23rd, 2004 at 7:00pm
Print Post Print Post  
Thanks.

I need to study that supplement. I missed lots on lots of  goodies that you pointed out in this thread.

Thanks again for all your 'coaching'

Excellent service, as always.

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #23 - Jul 25th, 2004 at 1:46am
Print Post Print Post  
Erika,

The Combo Boxes need major Help!

I've been working with the new "Deadly" stringarray commands on the combo box's almost the entire day trying to allow a user to "drill down" to a specific selection across 4 combo boxes. Making each box auto-populate using xlookups based on the users previous selection.

While I finally got it to do what I wanted, I've crashed sesame probably 50 times or more and permanently damaged a whole slew of working databases. Thank goodness for backups.

I've learned a few things that I thought i should share about combo boxes.

Most of my testing was done in Search mode and each box begins with:

if @mode=2 and box1 <> "" then...

On Element Change is firing during "On element exit" (without making a change) AND "On retrieve spec open". While in Update mode, Pressing f7 to go into search mode, the screen clears, thus firing the combo boxes. Putting @askuser in the On element change causes the mode change to pause. (in my case, xlookups were firing, and possibly colliding.)

Also, pressing f3 in search mode to clear all fields is firing each box. I got around this by adding If box1 <> "" after the @mode=2 condition.

Also, pressing F10 while the cursor is sitting in a box will also cause the box to fire. This is also causing unexpected results and crashes.

I beleive that if you try to run most/all of the new string array commands on a string that does not exist, Sesame will crash. (It should return 0?) Especially Populatelistelement.

After doing a search and returning no results, the On element change fires with each "On entry" and "On exit" event while in search mode. (Then sesame crashes while trying to exit)

I pasted a program from one of the boxes below. The system seems to work great, MOST OF THE TIME. I think the error may occur when no results are found.

Do you have any suggestions?

Thanks
Steve

var vduped as string
var vstring as string
var x as int =1
var vcollection as string
var vstripped as string
var vlist as string
var vfindcounter as int = 0
var vpatterns as string
var vpattern as string
var vdump as string
var vfind as int = 1

if @mode() = 2 and collection <> "" then
{

if @askuser("Collections wants to fire. OK?","","")
{
if mfgr <> "" and collection <> ""
{
vmasterlist= @xlookupsourcelistall(@fn, mfgr, "admin!mfgr", "collection;pattern;color")
if vmasterlist <> ""
{
//writeln("1 vmasterlist = " + vmasterlist)
vlist = @replace(vmasterlist, ";", "|")         
//writeln("2 vlist = " + vlist)
vlist = @replace(vlist, @newline(), ";")
//writeln("3 vlist = " + vlist)
vstripped = @containsstringarray(vlist, collection, 1)  ///build string of ALL matching collections tied to patterns and colors
//writeln("4 vstripped = " + vstripped + @newline())
vstripped = @replace(vstripped, collection, "+")
//writeln("5 vstripped = " + vstripped + @newline())
vstripped = @replace(vstripped, "+|", "")
//writeln("6 vstripped = " + vstripped + @newline())
while @instr(vstripped, "|")>0
{
vpatterns = vpatterns +split(vstripped, "|") + ";"
vdump = split(vstripped, ";")
}
//writeln("7 vpatterns = " + vpatterns + @newline())
if vpatterns <> "" then vduped = @sortstringarray(vpatterns, 0)       //alphebetize the list

//writeln("Vduped list of Patterns = "+vduped)
//vpattern = "test2;test1;"
while @len(vduped)>0                        // strip out the dupes
{
if @instr(vduped, ";")>0 then vstring=split(vduped, ";") else vstring = split(vduped, @newline())
vfind=@findstringarray(vpattern, vstring)
if vfind <1 then vpattern = vpattern + vstring + ";"
//writeln("Final results for combo box :" + vpattern)
vstring = ""
}

if vpattern <> "" then
{
clear(pattern, color)
populatelistelement(pattern, vpattern)      //put the list into the Pattern combo box
populatelistelement(color, "")
}
//writeln("now populate with : "+vpattern)
}
} //end if xlookupsourcelist failed
} //end if not in search mode
}





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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #24 - Jul 25th, 2004 at 1:21pm
Print Post Print Post  
Steve,

Most of the issues you mention with combo boxes are actually the same thing. This is the one I said earlier that we just took care of. The Change event sometimes fires when it shouldn't. We'll also check your other conditions and see if we caught them all.

We are looking the thing where StringArray functions don't appreciate being called on something that isn't one.

I'm most concerned with your statement that any of these issues are actually corrupting your applications. What are you seeing that makes you believe the app is "permanently damaged"? Whatever this is, we want to track it down and make it go away. Can we have one that is in this damaged condition?
  

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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #25 - Jul 25th, 2004 at 3:06pm
Print Post Print Post  
Steve,

We've been trying to create your failure conditions, but have not been able to do so. The String Array functions we've tried and looked at are prepared to handle blank values, so we don't think that that is, in itself, the problem. Could you send in your app along with some instructions for how to replicate the problem so we can put it in the debugger and see what you are seeing?

Thanks!
  

- 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: Relational / Combo-Box Programming help?
Reply #26 - Jul 25th, 2004 at 3:14pm
Print Post Print Post  
Thanke Erika,

I want to give you more details on my damaged apps while its fresh on my mind.

When I would reconcile and test my program in runtime, the client would crash and sunlock would not unlock the db. The only way to re-open the db would be to shut down sesame server, unlock, then restart the server.

Since I was connected remotely, this was too time consuming and troublesome, so when it would crash, I would make another change to the programming in dsr, then save as a new application (I wasnt allowed to save over the crashed app).

Then I would open that new application and test it out. (Server still showed the crashed application as being open, while I was working in the new application.)

Somewhere during this process, I got to a point where I couldnt open other forms and pull up a record. As soon as the first record started to show on the screen, Sesame would crash and I would get a message "The instruction at "0x004b38ff" referenced memeory at "0x0170a000". The memory could not be 'written'. Click OK to Terminate the program". Usually followed by the message "The instruction at "0x77f58cdc5" referenced memory at "0xffffffff8". The memory could not be "read". Click OK to terminate the program".

After seeing this, I thought I was having a hardware failure so I moved the app to another computer, and connected from a different client, but same results. I then took out all my combo box programming and tested again. Same thing. I couldn't retrieve any records!

I rolled back to the last 2 or 3 saved apps and they all had the same issues, so I rolled back to a backup from yesterday and all was fine.

I'll email the last ap with the error before I rolled back to a working app. I hope this gave you enough clues to know where to look.

Thanks for listening and responding.

Steve


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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #27 - Jul 25th, 2004 at 3:22pm
Print Post Print Post  
Steve,

The client crashing does not necessarily take down the Server. The Server may still be running happily with your app still loaded. Sunlocking a validly loaded app is a bad thing to do. You may have simply been able to reconnect a Client and keep working. I suspect that you may, somewhere in all the saving of new apps and sunlocking, forced an overwrite of loaded application files. This would cause much badness.

I don't think your code itself is eating your apps, which I'm quite happy about!
  

- 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: Relational / Combo-Box Programming help?
Reply #28 - Jul 25th, 2004 at 3:29pm
Print Post Print Post  
I just edited my above post slightly. (added a second error message).

Using the Sunlock tool is a pain when working remotely, so I probably only used it when I got the message, "db failed to open".

btw, the unlock feature in the server admin on the client pc rarely has any affect for me. ( cant remember when the last time it actually unlocked the db).

What's been happening A LOT lately, is that the client would crash, but the server did not know it crashed and is still running 'happily'. However, the client can not re-connect to the server and the server still shows the app is 'open'. I'm always having to restart sesame server because a client cant reconnect for this reason, or for some other reason. Probably at this time, I would run sunlock since I'm at the server and its the only convenient time to do so.

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #29 - Jul 25th, 2004 at 3:34pm
Print Post Print Post  
I think your right. I did something to a loaded app that caused a problem.

i thought that an "open ap" was an ap that was in use by a client.  I knew no clients were open, so I thought this was a bad thing and tried to restart or unlock it.

But heres why:

I just crashed twice so I could give you the error messages. The server is still running 'happily', BUT is showing :
Open Applications:
System Database
RugStudio
Rugstudio

This is why I would restart the server. It should not show Rugstudio at all, right? (No clients are open becuase they crashed.
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #30 - Jul 25th, 2004 at 6:07pm
Print Post Print Post  
Erika,

Sorry for the wild goose chase, but I think its the populatelistelement that is the culprit..

I had a typo in the stringarray command so populatelistelement was either blank or had invalid characters and was causing a crash.

Also, early on I was populating the combo box with info pulled from an xlookup. In preview mode, the xlookup didnt work, so there was no string to send to the populatelistelement command. I was crashing everytime I went into preview mode. An 'If <> ""' helped out there.


Shall I send in my ap?

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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #31 - Jul 25th, 2004 at 6:16pm
Print Post Print Post  
The blank value in Preview shouldn't be causing the crash. PopulateListElement is managing a failed Xlookup fine in our testbed. So, yes, we'd still like to see the app.

Invalid characters may cause a problem, but, even so, we'd like to discover what those characters are so we can try to intercept them.
  

- 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: Relational / Combo-Box Programming help?
Reply #32 - Jul 26th, 2004 at 1:48am
Print Post Print Post  
Erika,

I just emailed my app to you. Its held together with a bunch of 'If/then statements' and duct tape Smiley

No need to send it back unless you can fix the combo boxs to fire only when they are supposed to. Otherwise, I'll just put the commands in a button until the next patch comes out.  Cry

Thanks again for all your help and the 'overtime tutoring' this weekend.

Steve

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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #33 - Jul 26th, 2004 at 5:12pm
Print Post Print Post  
Steve,

I also responded to you privately, but the problem is that you are returning a blank value from the X command, then passing it to @SortStringArray, then trying to check its length. If @SortStringArray is handed an empty string to sort, it can return a true NULL. If you then try to operate on that variable, you will likely crash.

We've now forced it to return a zero-length string in that case, but, meanwhile, if you don't get a value back, don't try to sort it!  Smiley
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged