DB LOB 一危 覿り鍵
==========================

//#include "jpeg.hpp" 伎狩

//企語襯 TImage 覿 り鍵  豌襴覿覿
TJPEGImage *jpg = new TJPEGImage;
try{
	TBlobField *bf = dynamic_cast< TBlobField* >(photoQ->FieldByName("s_photo"));
	jpg->Assign(bf);
	s_photo_image->Picture->Graphic = jpg;
}
__finally{
	delete jpg;
}




DB LOB一危 ロ蠍
========================

/*************** Main Data Module ***********************************************************

insert into student(STUDENT_NUM, JUMIN_NUM, S_NAME, PASSWD, GUBUN, GRADE, SEX, 
										EMAIL, HABITATION, PHONE_NUM, S_ADDR, RELIGION, R_PART, CHURCH, S_PHOTO)
values (:STUDENT_NUM, :JUMIN_NUM, :S_NAME, :PASSWD, :GUBUN, :GRADE, :SEX, :EMAIL, 
				:HABITATION, :PHONE_NUM, :S_ADDR, :RELIGION, :R_PART, :CHURCH, :S_PHOTO) 
			
*********************************************************************************************/



        String jumin = jumin_Edit1->Text + jumin_Edit2->Text;

        String param[] = {snum_Edit->Text,
                        jumin,
                        sname_Edit->Text,
                        pw_Edit1->Text,
                        gubun_Combo->Text,
                        grade_Combo->Text,
                        sex_Combo->Text,
                        email_Edit->Text,
                        habi_Combo->Text,
                        phone_Edit->Text,
                        addr_Edit->Text,
                        religion_Combo->Text,
                        rpart_Edit->Text,
                        church_Edit->Text};

        //  覲  蟆
        check();

        if(ck == 1){
                //貉れ 覲蟆
                TCursor OldCursor = Screen->Cursor;
                Screen->Cursor = crSQLWait;

                //朱誤 
                for(int i=0; i<=13; i++)
                        if(i == 5)
                                MainDM->StudentRegQ->Parameters->Items[i]->Value = StrToInt(param[i]);
                        else
                                MainDM->StudentRegQ->Parameters->Items[i]->Value = param[i];

                if(photo_Edit->Text.IsEmpty())
                        MainDM->StudentRegQ->Parameters->Items[14]->Value = param[14];
                else
                        //LoadFromFile 伎伎 一危磯伎れ 讌  k.
                        //ADOQuery貉危語 覩碁Μ INSERT覓瑚骸 語ろ碁  語  .
                        // 覦企襴 一危磯ゼ る0 襦襯 伎 蟆 蠏 蟠
                        //伎 INSERT覓語朱 一危磯ゼ 曙蟆 覃 覦企襴襯 覓語企 覦蠖 ″螻
                        //覓語企 覦蠑手 覯 れ 覦企襴朱 覦蠑語伎狩 殊 伎狩
                        //企 るる 覓語伎 覦企襴覲企 2覦一    螳讌蠍 覓語
                        //ロ襦襯 伎覃 ろ語碁所骸 CPU煙 ろ   覈
                        MainDM->StudentRegQ->Parameters->Items[14]->LoadFromFile(photo_Edit->Text,ftBlob);

                MainDM->StudentRegQ->ExecSQL();
                MainDM->StudentRegQ->Close();

                //貉れ襯  ろ襴一 貉れ襦 覲蟆
                Screen->Cursor = OldCursor;

                ShowMessage(" 焔 炎概朱 企 譟給.");
                Close();
        }

DB 覦企襴一危 れ企
==============================


   //donwQ --> ADOQuery Component
   downQ->Close();
   downQ->SQL->Clear();
   int id = dataDownQ->Fields->Fields[0]->AsInteger;
   downQ->SQL->Add("select lecture_data from lecture_data ");
   downQ->SQL->Add("where id =" + IntToStr(id) );

	 //dataDownQ 蠏碁Μ 貉危語 郁屋 ..
	 // 7覯讌  朱 螳 曙...
   SaveDialog->FileName = dataDownQ->Fields->Fields[7]->AsString;
   if(SaveDialog->Execute()){
      if( FileExists(SaveDialog->FileName) ){
         if( Application->MessageBox("伎 殊  一蟆給蟾?", " ", MB_YESNO ) == IDNO )
         return;
      }

      AnsiString fname = SaveDialog->FileName;


      //貉れ 覲蟆.
      TCursor OldCursor = Screen->Cursor;
      Screen->Cursor = crSQLWait;

      downQ->Open();

      //貉れ襯 襦 覲蟆
      Screen->Cursor = OldCursor;

      //一危磯ゼ れ企  貊
      //覦 ろ碁殊朱 覦狩
      TStream *st;
      TFileStream *fs = new TFileStream(fname, fmCreate);
      try{
            st = downQ->CreateBlobStream((downQ->FieldByName("lecture_data")), bmRead);
            fs->CopyFrom(st, st->Size);
      }
      __finally{
         delete fs;
      }
      delete st;
   }









覿り鍵 谿曙 ..... -- 蟾燕 2012-11-25 10:46:57