Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[8520] Re:[질문] 코딩이 어디가 잘못됐는지..알려주세요~
조준회 [] 1492 읽음    2002-12-05 09:36

[Error] u2.pas(72): Undeclared identifier: 'parameters' 
위 메세지의 의미를 잘 생각해 보시면 됩니다.

Query1에는 parameters라는 메쏘드나 프로퍼티가 없습니다.

에러 메세지에 주의를 기울이시기 바랍니다.

효진 님이 쓰신 글 :
: [Error] u2.pas(72): Undeclared identifier: 'parameters'
: [Error] u2.pas(72): Missing operator or semicolon
: 이러한 에러가 납니다...어디가 잘못됐는지..알려주세요~
: unit u2;
:
: interface
:
: uses
:   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
:   Dialogs, StdCtrls, Buttons, DBCtrls, Mask, DB, DBTables, Grids, DBGrids;
:
: type
:   TForm2 = class(TForm)
:     Label1: TLabel;
:     Label2: TLabel;
:     Label3: TLabel;
:     Label4: TLabel;
:     Label5: TLabel;
:     Label6: TLabel;
:     Label7: TLabel;
:     DBEdit2: TDBEdit;
:     DBEdit3: TDBEdit;
:     DBEdit4: TDBEdit;
:     DBEdit5: TDBEdit;
:     DBEdit6: TDBEdit;
:     BitBtn1: TBitBtn;
:     BitBtn2: TBitBtn;
:     BitBtn3: TBitBtn;
:     BitBtn4: TBitBtn;
:     BitBtn5: TBitBtn;
:     DBComboBox1: TDBComboBox;
:     DataSource1: TDataSource;
:     Query1: TQuery;
:     DBEdit1: TDBEdit;
:     DBGrid1: TDBGrid;
:     procedure FormCreate(Sender: TObject);
:     procedure BitBtn1Click(Sender: TObject);
:     procedure BitBtn2Click(Sender: TObject);
:     procedure BitBtn3Click(Sender: TObject);
:     procedure BitBtn5Click(Sender: TObject);
:     procedure BitBtn4Click(Sender: TObject);
:
:
:   private
:   db_insert: string;
:   procedure db_refresh;
:   procedure db_input;
:   procedure cls_edit;
:   procedure dsp_edit;
:     public
:     { Public declarations }
:   end;
:
: var
:   Form2: TForm2;
:
: implementation
:
: uses u1;
:
:
:
: {$R *.dfm}
: procedure TForm2.DB_Refresh;
: begin
:  Query1.Close;
:  query1.SQL.Clear;
:  Query1.SQL.Add('Select * From hakjuk');
:  Query1.SQL.Add('Order By hakbun');
:  Query1.Open;
: end;
:
: procedure TForm2.DB_Input;
: begin
: Query1.parameters.Paramvalues['N1'] := Trim(dbEdit1.Text);
: Query1.Parameters.ParamValues['N2'] := Trim(dbEdit2.Text);
: Query1.Parameters.ParamValues['N3'] := Trim(dbEdit3.Text);
: Query1.Parameters.ParamValues['N4'] := Trim(dbcombobox1.Text);
: Query1.Parameters.ParamValues['N5'] := Trim(dbEdit4.Text);
: Query1.Parameters.ParamValues['N6'] := Trim(dbEdit5.Text);
: Query1.Parameters.ParamValues['N7'] := Trim(dbEdit6.Text);
: end;
:
: procedure TForm2.Cls_Edit;
: begin
:  dbEdit1.Text := '';
:  dbEdit2.Text := '';
:  dbEdit3.Text := '';
:  dbEdit4.Text := '';
:  dbEdit5.Text := '';
:  dbEdit6.Text := '';
:  dbcombobox1.Text := '';
: end;
:
: procedure TForm2.Dsp_Edit;
: begin
:  dbEdit1.Text := Query1.FieldByName('hakbun').AsString;
:  dbEdit2.Text := Query1.FieldByName('name').AsString;
:  dbEdit3.Text := Query1.FieldByName('birth_day').AsString;
:  dbEdit4.Text := Query1.FieldByName('grade').AsString;
:  dbEdit5.Text := query1.FieldByName('tel_no').AsString;
:  dbEdit6.Text := Query1.FieldByName('hp_no').AsString;
:  dbcombobox1.Text := Query1.FieldByName('hakgwa').AsString;
: end;
:
:
: procedure TForm2.FormCreate(Sender: TObject);
: begin
: cls_edit;
: dsp_edit;
: db_insert := '불가능';
: end;
:
: procedure TForm2.BitBtn4Click(Sender: TObject);
: var
:   Input_Str: string;
: begin
:
:  Input_Str:= InputBox('이름 입력', '찾을 이름을 입력하세요','');
:
:  if Trim(Input_Str) <> '' Then
:  begin
:   Query1.Close;
:   Query1.SQL.Clear;
:   Query1.SQL.Add('Select * From hakjuk');
:   Query1.SQL.Add('Where name Like :NAME1');
:   Query1.Parameters.ParamByName('NAME1').Value := '%' +Input_Str + '%';
:   Query1.Open;
:  end;
: end;
:
: procedure TForm2.BitBtn1Click(Sender: TObject);
: begin
: if bitbtn1.caption = '삽입' then
:   begin
:    db_insert := '가능';
:    bitbtn1.caption := '취소';
:    bitbtn2.Enabled := false;
:    Cls_edit;
:    end
:    else
:    begin
:    db_insert := '불가능';
:    bitbtn1.caption := '삽입';
:    bitbtn2.Enabled := true;
: db_refresh;
: dsp_edit;
: end;
: dbedit1.SetFocus;
: end;
:
:
:
: procedure TForm2.BitBtn3Click(Sender: TObject);
: var
: select_no : integer;
: begin
:  if trim(dbedit1.text) = '' then
:   begin
:     showmessage('이름을 입력하지 않으면 추가나 저장을 할 수 없습니다.');
:     dbedit1.SetFocus;
:     exit;
:     end;
:     if db_insert = '가능' then
:     begin
: Query1.Close;
: query1.SQL.Clear;
:   Query1.SQL.Add('Insert Into hakjuk ');
:   Query1.SQL.Add('(hakbun, name, birth_day, hakgwa, grade, tel_no, hp_no) ');
:   Query1.SQL.Add(' Values ');
:   Query1.SQL.Add('( :N1, ');
:   Query1.SQL.Add('  :N2, ');
:   Query1.SQL.Add('  :N3, ');
:   Query1.SQL.Add('  :N4, ');
:   Query1.SQL.Add('  :N5, ');
:   Query1.SQL.Add('  :N6, ');
:   Query1.SQL.Add('  :N7 )');
:   DB_Input;
:    db_insert := '불가능';
:     bitbtn1.caption := '삽입';
:     bitbtn2.Enabled := true;
:     end
:     else
:     begin
:     Select_no :=  Query1.FieldByName('bunho').AsInteger;
: Query1.Close;
:   Query1.SQL.Clear;
:   Query1.SQL.Add('Update hakjuk ');
:   Query1.SQL.Add('Set hakbun = :N1, ');
:   Query1.SQL.Add('name = :N2, ');
:   Query1.SQL.Add('birth_day = :N3, ');
:   Query1.SQL.Add('hakgwa = :N4, ');
:   Query1.SQL.Add('grade = :N5, ');
:   Query1.SQL.Add('tel_no = :N6 ');
:     Query1.SQL.Add('hp_no = :N7 ');
:   Query1.SQL.Add('Where bunho = :N8 ');
:   DB_Input;
:   Query1.Parameters.ParamValues['N8'] := Select_no;
:  end;
:
:  Query1.ExecSQL;
:  DB_Refresh;
:  dbEdit1.SetFocus;
: end;
:
: procedure TForm2.BitBtn2Click(Sender: TObject);
: var
: ret_msg : integer;
: select_no : integer;
: begin
: if Query1.Recordset.Fields.Count <> 0 then
:  begin
:  ret_msg := messagedlg('삭제하시겠습니까?', mtwarning,
:  [mbyes, mbno],0);
:  if ret_msg = mryes then
: begin
: Select_no :=  Query1.FieldByName('bunho').AsInteger;
:     Query1.Close;
:     Query1.SQL.Clear;
:     Query1.SQL.Add('Delete From hakjuk ');
:     Query1.SQL.Add('Where bunho = :N1');
:     Query1.Parameters.ParamValues['N1'] := Select_no;
:     Query1.ExecSQL;
:     DB_Refresh;
:     Dsp_Edit;
:   end
:   else
:   Application.MessageBox('삭제가 취소되었습니다.',
:                          '삭제취소',MB_OK);
:  end;
:
:
:
:
:  procedure TForm2.BitBtn5Click(Sender: TObject);
: begin
: form1.show;
: end;
:
:
:
:
:
: end.

+ -

관련 글 리스트
8518 [질문] 코딩이 어디가 잘못됐는지..알려주세요~ 효진 781 2002/12/05
8523     TQuery의 Help를 열심히 들여다 보시면 답이 있습니다. 여튼 답을 알려드리면... 박정모 810 2002/12/05
8520     Re:[질문] 코딩이 어디가 잘못됐는지..알려주세요~ 조준회 1492 2002/12/05
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.