>>I have tried setting the Database property, but Dataenvironment::Opentables() fails to find the table in the "other" database. Even when I select it from the Locate... prompt, Fox cannot seem to find it!
>
>The link seems to be broken.
>
>I will suggest to MODIFY DATABASE manually from the command prompt, remove the table and bring it back again.
Actually the problem is not with multiple DBC's but with the codebook base objects used in their ADATAENV.prg We have a large app with 5 DBC's to isolate local site data, reference data, third party ref. and optional feature tables. To cross the DBC in the DE you need to deal with the default database properties of the cookbook structures. One approach
is as follows:
DEFINE CLASS AllergysEnvironment AS EncaraEnvironment
cDefaultDatabaseName = 'PHARMLOC'
FUNCTION LoadCursors()
DIMENSION this.aCursors[2]
this.aCursors[1] = 'v_Allergys'
this.aCursors[2] = 'Severitysel'
ENDFUNC
ENDDEFINE
the v_Allergys view references tables in the PHARMLOC dbc and the severitysel view references a table in another DBC, PHARMREF
In the next piece of codebook class defines we
DEFINE CLASS SeveritySel AS CTableCursor
CursorSource = 'severitysel'
FUNCTION Init()
LOCAL llRetVal
llRetVal = CTableCursor::Init()
this.Database =STRTRAN(this.Database,
'PHARMLOC', 'PHARMREF')
RETURN llRetVal
ENDFUNC
ENDDEFINE
This takes care of the default database used in the ctablecuror init method when the DE is setup by DELOADER.
You can also manage this at the exec level by using multiple codebook business objects each with a single DBC reference and createobject(ing) on multiple business objects in a 'do' method on the form or whatever. I think there are some other solutions now available from FLASH and FoxExpress-check their web sites. When I first ran into this the response was 'you have apps with more than one DBC!?' Our reply was Yup and over 80 tables and 250+ views spead across them----welcome to industrial strenght applications!!!
Hope this helps some
Gary
Gary
Helping Make Ideas Reality