Accessing data record from a DDDW that has a composite key

Accessing data record from a DDDW that has a composite key

Post by Igor Kortchn » Wed, 11 Oct 1995 04:00:00

>I have a few entities in my database application that the user chooses via a
>composite key.  Example:  A telephone circuit is identified by my users by the
>circuit_no and the drop_no (HEX1223WT and 002).  I would like my user to open a
>window in the circuit field, display all the circuits and drops and select the
>record they want and have this data populate into my current application.
>The problem I have is when creating DropDown DataWindows (DDDW), they only
>require a single field as a key.  The circuit HEX1223WT may have over 10
>different drops, the only drop I am able to pull is the first drop with the
>chosen circuit_no.

Once the user have chosen his entry in the DropDataWindow do the

DataWindowChild dwc

// I assune that the drop-down is on the dw_1 datawindow
// and that the column you retrieve from the ddw is called
// "column_name"

long    l_row
dw_1.GetChild(column_name, dwc)
l_row = dwc.GetSelectedRow()

if l_row > 0 then
   do your proceedings
end if

There is a problem though. If many rows can have the same value for
this column, you cannot put this code directly in itemchanged event
handler for the main dw.

What you could do, though, is to modify the value shown in your dw, by
appending some characters to it ( also in itemchanged). Then the
itemchanged event will always work.

Before using the value shown (DB update or assigning this value to
something) you will then need to strip these additional characters.



1. Accessing data record from a DDDW that has a composite key

Steve, I take that you did not not write this DDDW module. The only
effective way is to modify this module to include an additional parameter
in the DDDW retrieval process - that's if you already know the circuit
no. If not, you can modify the SQL to link the two tables w/circuit no.
i.e, where table1.circuit_no = table2_circuit_no.  

Guy Richard

2. Minolta Dual Scanner

3. Accessing data record from a DDDW that has a

4. newbie question on type casting

5. accessing primary key slower than accessing non primary key???

6. Tool to port C++ to C#

7. composite primary key to foreign key

8. BOCAMODEM question

9. How do you remove keys from keyserver without having the private key?

10. Problem adding shapes/records becasue of Access's AutoNumber Key

11. How to fill data into COMPOSITE data window ?

12. Accessing data from other records while in a loop

13. keyed access, data step, mult. indices