휴~~ 저장이 안돼네엽.. 그래서 아예 소스를 통째로 올립니당.....ㅠ.ㅠ
정말 눈물 난당.... ㅠ.ㅠ
왜 에러가 날까엽.... 누가 좀 봐줘엽....그럼 고수님들의 가르침 기다림당.....
※ 에러내용은엽... Format'%s' invalid or incompatible with argument.
이상임당.......
procedure TForm1.SpeedButton4Click(Sender: TObject);
var
a,b,c,d,g,h,i,k,j,l:string;
e,f:tdatetime;
begin
b:=edit1.Text; //검사수량
c:=edit2.Text; //불량수랑
d:=edit3.Text; //양품수량
e:=datetimepick1.date; //검사일자
f:=datetimepick2.date; //입력일자
g:=combobox3.Text; //기종명
h:=combobox4.Text;//고객명
i:=combobox2.Text;//작업자이름
if radiobutton1.Checked=true then j:='1'
else if radiobutton2.Checked=true then j:='2';
if radiobutton3.Checked=true then k:='1' //검사구분
else if radiobutton4.Checked=true then k:='2';
with query6 do begin close;
sql.Clear;
sql.Add('select 공정코드 from 공정명세');
sql.Add('where 공정구분="'+combobox1.text+'"'); //검사결과
sql.Add('and 공정명 ="'+combobox2.Text+'"');
open; end;
if not query6.Eof then begin
a:=query6.fieldbyname('공정코드').asstring;
end;
if (b='') or (c='') or (g='') or(h='') or(i='') then begin
messagedlg('입력내용이 모자랍니다.',mtwarning,[mbok],0);
exit;
end;
l:=format('insert into 검사명세.db (공정코드,고객명,제품명,검사구분,검사수량,합격수량,불량수량,검사결과,검사일자,입력일자,검사자) values( "%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s")',[a,h,g,k,b,d,c,j,e,f,i]);
with query7 do begin
Close;
SQL.Clear;
SQL.Add(l);
ExecSQL;
end;
if messagedlg('불량등록 할 내용이 있습니까?',mtinformation,mbyesnocancel,0)= mryes then
begin
showwindow(handle,sw_hide);
form6.showmodal;
end;
end;
> 휴~~ 저장이 안돼네엽.. 그래서 아예 소스를 통째로 올립니당.....ㅠ.ㅠ
>
> 정말 눈물 난당.... ㅠ.ㅠ
>
> 왜 에러가 날까엽.... 누가 좀 봐줘엽....그럼 고수님들의 가르침 기다림당.....
>
> ※ 에러내용은엽... Format'%s' invalid or incompatible with argument.
>
> 이상임당.......
>
> procedure TForm1.SpeedButton4Click(Sender: TObject);
> var
> a,b,c,d,g,h,i,k,j,l:string;
> e,f:tdatetime;
> begin
> b:=edit1.Text; //검사수량
> c:=edit2.Text; //불량수랑
> d:=edit3.Text; //양품수량
> e:=datetimepick1.date; //검사일자
> f:=datetimepick2.date; //입력일자
> g:=combobox3.Text; //기종명
> h:=combobox4.Text;//고객명
> i:=combobox2.Text;//작업자이름
> if radiobutton1.Checked=true then j:='1'
> else if radiobutton2.Checked=true then j:='2';
> if radiobutton3.Checked=true then k:='1' //검사구분
> else if radiobutton4.Checked=true then k:='2';
> with query6 do begin close;
> sql.Clear;
> sql.Add('select 공정코드 from 공정명세');
> sql.Add('where 공정구분="'+combobox1.text+'"'); //검사결과
> sql.Add('and 공정명 ="'+combobox2.Text+'"');
> open; end;
> if not query6.Eof then begin
> a:=query6.fieldbyname('공정코드').asstring;
> end;
> if (b='') or (c='') or (g='') or(h='') or(i='') then begin
> messagedlg('입력내용이 모자랍니다.',mtwarning,[mbok],0);
> exit;
> end;
> l:=format('insert into 검사명세.db (공정코드,고객명,제품명,검사구분,검사수량,합격수량,불량수량,검사결과,검사일자,입력일자,검사자) values( "%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s")',[a,h,g,k,b,d,c,j,e,f,i]);
> with query7 do begin
> Close;
> SQL.Clear;
> SQL.Add(l);
> ExecSQL;
> end;
> if messagedlg('불량등록 할 내용이 있습니까?',mtinformation,mbyesnocancel,0)= mryes then
> begin
> showwindow(handle,sw_hide);
> form6.showmodal;
> end;
> end;
>
쩝...
날짜형이 문자형에 달아 서로 사맛디 아니할쎄..이를 어여비 여겨
datetostr 펑션을 맹가노니....어쩌구저쩌구
%s 는 문자를 형식을 받는 것인디
e,f 는 Tdatetime 이니까 거기서 에러가 나겠죠.....
간단히 이런식으로 바꾸면 될껄요....^^;
[a,h,g,k,b,d,c,j,datetostr(e),datetostr(f),i]
또는
[a,h,g,k,b,d,c,j,datettimeostr(e),datetimetostr(f),i]
황당한 답변은 계속 되야 함다.....쭈~~~~~욱~~~~