|
greatcbj 님이 쓰신 글 :
: void __fastcall TForm3::Music_SeachClick(TObject *Sender)
: {
: if ((Edit_Music->Text == ""))
: {
: ShowMessage("검색어를 입력하세요. ");
: return;
: }
:
: if (Form3->rdoMusic_Index == 0)
: {
: Query3->SQL->Clear();
: Query3->SQL->Add("select * from 잡지목록 where 순번=:Param1");
: Query3->ParamByName("Param1")->AsString = Edit_Music->Text; // Name
:
: Query3->Open();
: }
:
: else if (Form3->rdoMusic_Index == 1)
: {
: Query3->SQL->Clear();
: Query3->SQL->Add("select * from 잡지목록 where 제목=:Param2");
: Query3->ParamByName("Param2")->AsString = Edit_Music->Text; // Name
:
: Query3->Open();
: }
:
: else if (Form3->rdoMusic_Index == 2)
: {
: Query3->SQL->Clear();
: Query3->SQL->Add("select * from 잡지목록 where 출판사=:Param3");
: Query3->ParamByName("Param3")->AsString = Edit_Music->Text; // Name
:
: Query3->Open();
: }
:
: else if (Form3->rdoMusic_Index == 3)
: {
: Query3->SQL->Clear();
: Query3->SQL->Add("select * from 잡지목록 where 출간일=:Param1");
: Query3->ParamByName("Param1")->AsString = Edit_Music->Text; // Name
:
: Query3->Open();
: }
:
: 입니다. 여기서 else if 절 이후 Form3->rdoMusic_Index == 에서 에러가 딱걸리네요.
:
: 도와주세요...
:
안녕하세요 만해 입니다.
조금 간단한 질문이네요
rdoMusic_index 가 RadioGroup 컴포넌트가 맞다면요
rdoMusic_index->ItemIndex로 고쳐 보세요
그리고 ItemIndex는 -1값을 가진답니다. 참고 하세요
조금 쉽게 여러 루틴을 고쳐 보면요
switch (Form3->rdoMusic_Index->ItemIndex)
{
case -1 : ShowMessage("여기에 -1일 경우 처리할 루틴을 입력하세요");break;
case 0 :{
Query3->SQL->Clear();
Query3->SQL->Add("select * from 잡지목록 where 순번=:Param1");
Query3->ParamByName("Param1")->AsString = Edit_Music->Text; // Name
Query3->Open();break;
}
case 1:{
Query3->SQL->Clear();
Query3->SQL->Add("select * from 잡지목록 where 제목=:Param2");
Query3->ParamByName("Param2")->AsString = Edit_Music->Text; // Name
Query3->Open();break;
}
case 2:{
Query3->SQL->Clear();
Query3->SQL->Add("select * from 잡지목록 where 출판사=:Param3");
Query3->ParamByName("Param3")->AsString = Edit_Music->Text; // Name
Query3->Open();break;
}
case 3:{
Query3->SQL->Clear();
Query3->SQL->Add("select * from 잡지목록 where 출간일=:Param1");
Query3->ParamByName("Param1")->AsString = Edit_Music->Text; // Name
Query3->Open();break;
}
}
이런식으로 해도 괘안을지 않을까요?
|