Re: Database.e; db_select(); Can't make it work...
- Posted by ZNorQ <znorq at holhaug.com> Mar 26, 2007
- 612 views
ZNorQ wrote: > > I got a program that have 2 ".edb" files, and I'm trying to use db_select() > to switch between the three. > > When the program starts, it checks to see if the 2 files exists, and if they > don't - it creates them using the db_create(). > > Now, I thought that when using db_create() - this also acts as db_open() and > keeps those databases open, and that I'm then able to use db_select() to > switch between them. > > Example; > > <font color="#330033"><EuCode></font> > <font color="#FF00FF"> sequence </font><font color="#330033">jStatus</font> > <font color="#330033"> jStatus = {}</font> > <font color="#FF0055"> --</font> > <font color="#330033"> jStatus &= db_select(</font><font > color="#00A033">"c:\\Metadata.edb"</font><font color="#330033">)</font> > <font color="#330033"> jStatus &= db_create_table(</font><font > color="#00A033">"TBL_DOCUMENTS"</font><font color="#330033">)</font> > <font color="#FF0055"> --</font> > <font color="#330033"> jStatus &= db_select(</font><font > color="#00A033">"c:\\System.edb"</font><font color="#330033">)</font> > <font color="#330033"> jStatus &= db_create_table(</font><font > color="#00A033">"IDX_DOCUMENTS"</font><font color="#330033">)</font> > <font color="#330033"> jStatus &= db_select_table(</font><font > color="#00A033">"SYS_HEADINGS"</font><font color="#330033">)</font> > <font color="#330033"> jStatus &= db_insert(</font><font > color="#00A033">"TBL_DOCUMENTS"</font><font color="#330033">, </font><font > color="#00A033">"STR_DOC_NO"</font><font color="#330033">, </font><font > color="#00A033">"STR_DOC_TITLE"</font><font color="#330033">)</font> > <font color="#330033"> jStatus &= db_select_table(</font><font > color="#00A033">"SYS_AUTONUMBER"</font><font color="#330033">)</font> > <font color="#330033"> jStatus &= db_insert(</font><font > color="#00A033">"TBL_DOCUMENTS"</font><font color="#330033">, </font><font > color="#993333">{</font><font color="#00A033">"DOC" </font><font > color="#330033">& </font><font color="#00A033">"#"</font><font color="#330033">, > 1</font><font color="#993333">}</font><font color="#330033">)</font> > <font color="#FF0055"> --</font> > <font color="#330033"> jStatus &= db_select(</font><font > color="#00A033">"c:\\Metadata.edb"</font><font color="#330033">)</font> > <font color="#330033"> jStatus &= db_select_table(</font><font > color="#00A033">"TBL_DOCUMENTS"</font><font color="#330033">)</font> > <font color="#330033"></EuCode></font> > > > What happens here is that 2 tables are created in "Metadata.edb", but > the intention was that "TBL_DOCUMENTS" is created in "Metadata.edb", > and "IDX_DOCUMENTS" is created in "System.edb".. > > Can anyone spot what I'm doing wrong? > > Kenneth / ZNorQ Ah, forget it people. I just realized that I was missing the path variable in my original code.. Geeez... Regards Kenneth / ZNorQ