Re: EDB Question
- Posted by Jim Duffy <futures8 at earthlink.net> Feb 24, 2001
- 504 views
Hi, Tony, The EDS docs state: Comments Call this procedure when you are finished with the current database. Also note that db_open() and db_create() both make the database just opened or created the current database. So, it would seem that when you db_close() the current database, then the database opened (or created) previous to that one becomes the current database. However, that results in an error. The db_select() in the last if statement is required, else it seems that no open database is current. (Probably, only Rob can verify that). But once selected(), the EDB will require its own db_close(). Hope this helps. The following example worked for me: with trace sequence s trace(1) if db_open("PATTHIST", DB_LOCK_EXCLUSIVE) != DB_OK then puts(1, "Could not open database PATTHIST.EDB. Aborting ...\n") abort(1) end if if db_open("COMMDATA", DB_LOCK_EXCLUSIVE) != DB_OK then puts(1, "Could not open database COMMDATA.EDB. Aborting ...\n") abort(1) end if s = db_table_list() -- just to verify what EDB you've got here db_close() if db_select("PATTHIST") != DB_OK then puts(1,"PATTHIST.EDB could not be selected. Abort.") abort(1) end if s = db_table_list() -- just to verify what EDB you've got here db_close() Regards, Jim Tony Steward wrote: > > Hi, > Does db_close() close all EDB's that are open or just the current EDB. > > Thanks Tony > > Come visit me at www.locksdownunder.com >