|
우선 화면에...세게의 필드가 보이도록...다음과 같이 컴포넌트를 셋팅하였습니다
ListField : cust_id;cust_name;cust_tel
이렇게 하니깐 쿼리에서 올라온 값이 리스트 박스에 보이더군요
.....
하고싶은 작업은 클릭했을때...이값을 저장 하고 싶다는 겁니다.
그래서 OnClick Event가 발생했을때..DBLookupListBox1_OnClick함수가 실행되도록 이벤트 설정을 하고
다음과 같이 코딩 했습니다.
void __fastcall TForm1::DBLookupListBox1_OnClick(TObject *Sender)
{
AnsiString str1,str2,str3;
DBLookupListBox1->ListFieldIndex = 0; /*cust_id */
str1 = DBLookupListBox1->SelectedItem;
DBLookupListBox1->ListFieldIndex = 1; /*cust_name*/
str2 = DBLookupListBox1->SelectedItem;
DBLookupListBox1->ListFieldIndex = 2;/*cust_tel*/
str3 = DBLookupListBox1->SelectedItem;
}
예상하는 값은
str1 = 1, str2 = 이미숙, str3 = 011-888-2222인데...
실제로 값은
str1 = 1, str2 = 1 str3 = 1 만 들어 옵니다.../*모두 cust_id값만 들어옴 */
무엇을 잘못한 것일까요??
갈켜 주시면 감사하겠습니다.
|