1. EDS and Win32lib


new topic     » topic index » view message » categorize

2. EDS and Win32lib

Hey, thanks for the help you all have been giving me.  Here's my 
question.  I have several editText boxes that where I can enter 
information and store it in the EDS.  My problem is that when I use the 
getText procedure and say from my first edit box and put it into the 
table created by EDS I get several error messages.

Code is very short for testing at this point

procedure addtositetable()
  sequence key
   
  
  key = getText(sitecode)

  if db_insert(key, {}) != DB_OK then 
         duh = message_box("Files did not save", "Warning!", 
MB_TASKMODAL + MB_ICONWARNING)
  end if


end procedure

new topic     » goto parent     » topic index » view message » categorize

3. Re: EDS and Win32lib

----- Original Message -----
From: Michael <mb7001 at earthlink.net>
Subject: EDS and Win32lib


>
> Hey, thanks for the help you all have been giving me.  Here's my
> question.  I have several editText boxes that where I can enter
> information and store it in the EDS.  My problem is that when I use the
> getText procedure and say from my first edit box and put it into the
> table created by EDS I get several error messages.
>
> Code is very short for testing at this point
>
> procedure addtositetable()
>   sequence key
>
>
>   key = getText(sitecode)
>
>   if db_insert(key, {}) != DB_OK then
>          duh = message_box("Files did not save", "Warning!",
> MB_TASKMODAL + MB_ICONWARNING)
>   end if
>
>
> end procedure

Providing you have opened the database and selected the appropriate table,
then
that error most likely means you already have a key by that name in the
database table.
More code is needed to tell much more than that.
Try capturing the return code, and checking it against DB_EXISTS_ALREADY.

x = db_insert_key(blah........)
 if x = DB_EXISTS_ALREADY then (display "Duplicate Key" error)

Regards,
IRv

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu