Hi Jeff,
I'm just trying to reproduce your problem. 
When setting the database active with SET DATABASE or OPEN DATABASE the
right databae is activated. When opening the table using the
dbname!tablename syntax the last opened database is queried first for the
table, no matter what database is currently active. 
A workaround is selecting the DB, close it and reopen it before opening a
table. Problem here is that already opened tables are automagically closed.
However if you are using a procedure to open up all tables/views in a db
with an unique alias this can help you out.

Btw, Opening the tables using USE .\db1\databasename.dbc!table also refers
to the correct table.
Maybe you can rewrite the USE calls to semething like this:
SelUse("table1", .t.)

Function SelUse()
        LPARAMETER tcTableName, tcAlias, tlDatabase
        IF VARTYPE(tcAlias) <> "C"
                tcAlias = JUSTSTEM(tcTableName)
        ENDIF
        IF tlDatabase AND NOT EMPTY(DBC())
                lcDB = DBC()
                SELECT 0
                USE (lcDB + "!" + tcTableName) ALIAS (tcAlias)
        ELSE
                SELECT 0
                USE (tcTableName) ALIAS (tcAlias)
        ENDIF
EndFunc

Regards,
Sietse
-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Namens Jeff Johnson
Verzonden: vrijdag 18 mei 2007 20:17
Aan: [EMAIL PROTECTED]
Onderwerp: Multiple Databases Same Name

I have multi-site applications where the database name and table structures
are the same and different sites are stored in different folders.

 

            Application\Site1\files.dbc

            Application\Site2\files.dbc

                        Etc.

 

I have been doing this for a long time, only now I have a new app that is
consolidating data from all sites.  VFP only recognizes one dbc name
regardless of how many are open with that name.

 

I can open .\site1\files.dbc and .\site2\files.dbc.  I can "SET DATABASE TO
.\site2\files.dbc" and it will not change from site1.  This is related to a
thread I started a couple of weeks ago about backing up a dbc.

 

Does anyone know of a work around?  I guess the only solution at this point
is to modify everything to open up tables by full path rather than
dbc!table.

 

Jeff

 

Jeff Johnson

[EMAIL PROTECTED]

623-582-0323

Fax 623-869-0675

 



--- StripMime Report -- processed MIME parts ---
multipart/signed
  multipart/alternative
    text/plain (text body -- kept)
    text/html
  application/x-pkcs7-signature
---

[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL 
PROTECTED]@sw-software.nl
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to