Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataEnvironment Class problem
Message
From
30/12/2002 11:50:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
30/12/2002 09:21:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00736556
Message ID:
00736605
Views:
15
>I have problem which I can't understand.
>I have created DE Class for my database which hold two tables and relation between them.
>The code is this:
>
>
>
>#DEFINE databasepath "C:\mydirectory\"
>
>DEFINE CLASS CUSTOMERS AS cursor
>    alias = "CUSTOMERS"
>    cursorsource = "CUSTOMER"
>    database = DATABASEPATH + "BUSINESS.DBC"
>ENDDEFINE
>
>DEFINE CLASS ORDERS AS cursor
>    alias = "ORDERS"
>    cursorsource = "ORDERS"
>    database = DATABASEPATH + "BUSINESS.DBC"
>ENDDEFINE
>
>DEFINE CLASS ORDERS_TO_CUSTOMERS AS relation
>    childalias = "CUSTOMERS"
>    parentalias = "ORDERS"
>    RelationalExpr = "CID_ORDER"
>    childorder = "CID_ORDER"
>ENDDEFINE
>
>DEFINE CLASS businessDE AS DataEnvironment
>    ADD OBJECT oCUSTOMERS AS CUSTOMERS
>    ADD OBJECT oORDERS AS ORDERS
>    ADD OBJECT oORDERS_TO_CUSTOMERS AS ORDERS_TO_CUSTOMERS
>
>	PROCEDURE Init()
>		this.OpenTables()
>	ENDPROC
>	
>	PROCEDURE Destroy()
>		this.CloseTables()
>	ENDPROC
>ENDDEFINE
>
>
>
>When I try to create instance of this class:
>oDE = CREATEOBJECT('businessDE')
>it shows this: "Variable 'CID_ORDER' is not found.'.
>and it shows (de)bug on this.OpenTables().
>
>When I remove relation class (ORDERS_TO_CUSTOMERS) creation of instance is OK but there is no relation between table.
>
>What is the problem? Can anybody help me?

Boban,
An index tag named 'CID_ORDER' exists but does a field named 'CID_ORDER' exist ? IOW in code can you do this :

open data (DATABASEPATH+"Business.dbc")
use orders
use customer in 0 order tag CID_ORDER alias customers
set relation to CID_ORDER into customers && No error here ?

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform