Re: Error trying to close EDS database

new topic     » goto parent     » topic index » view thread      » older message » newer message

ronaustin at alltel.net wrote:

>  
>
> The following program allows me to add one record and then blows up 
> when I try to add a second record.  It says I should look in ex.err, 
> which is a 57K file that I don't understand.  Does anyone see any 
> obvious problems with this program as far as I have got with it?
>  
> As you can see, I have not done any error trapping yet, and I have got 
> to come up with a way to get, display and edit a record, but first I 
> am just trying to write out a record.
>  
> I used the edb.exw program to look at the database and there is one 
> record saved in the Diagnosis table.
>  
>
> -- eyediag.exw
>
> -- Diagnosis Code Maintenance
>
>  
> include win32lib.ew
>
> include database.e
>
> without warning
>
> integer err
>
>  
> constant
>
>     Win     =  create( Window, "Diagnosis Code Maintenance", 0, 
> Center, Center,350,200,0),
>
>                         
>
>     Lbl1 = create(LText,"Code",Win,20,30,60,20,0),
>
>     Code = create(SleText,"",Win,80,30,42,20,0),
>
>     Lbl2 = create(LText,"Description",Win,20,80,60,20,0),
>
>     Desc = create(SleText,"",Win,80,80,248,20,0),
>
>     
>     Save_Rec = create(PushButton, "Save",Win,25,130,80,20,0),
>
>     Delete_Pat = create(PushButton, "Delete",Win,250,130,80,20,0)
>
>    
> -- run code
>
>    err= db_create("Eye-Comp", DB_LOCK_NO)
>
You should now create your table here...
    err = db_create_table("Diagnosis")

>   
>
>    setWindowBackColor(Win,rgb(0,255,127))
>
>    setFocus(Code)
>
>   
>      procedure Save_Diag(integer self, integer event,sequence parms)
>
>            err = db_open("Eye-Comp",DB_LOCK_NO)
>
>            err = db_create_table("Diagnosis")
>
Instead of "db_create_table()," use "db_select_table()."

This is probably what's causing the problem.

>            err = db_insert(getText(Code),getText(Desc))
>
>            db_close()
>
>      end procedure
>
>         
>     setHandler(Save_Rec,w32HClick,routine_id("Save_Diag"))
>
>  
> WinMain( Win, Normal)
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu