Re: Trouble with Database(EDS)

new topic     » goto parent     » topic index » view thread      » older message » newer message
Icy_Viking said...

Ok I got it to open after deleting the previously made database. How do I make it so I can test it without the couldn't create database error coming up again? I'm using the Eu4 version of EDS.

Here is a quick shorthand function you can use to always open your database with the correct method.

include std/eds.e 
 
public function db_load( sequence path, integer lock_mode = DB_LOCK_EXCLUSIVE ) 
     
    if db_select( path ) = DB_OK then 
        return DB_OK 
    end if 
     
    if db_open( path, lock_mode ) = DB_OK then 
        return DB_OK 
    end if 
     
    return db_create( path, lock_mode ) 
end function 

-Greg

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

Search



Quick Links

User menu

Not signed in.

Misc Menu