많은 튜토리얼에서 datasnap 클라이언트의 데이터베이스에서 데이터를 선택하는 방법을 읽습니다. dbgrid를 완료하십시오. 하지만 이제 행을 삽입하거나 업데이트하는 방법을 알아야합니다 (p.e "new client"). 모두가 나에게 책이나 튜토리얼을 추천 할 수 있습니까?DataSnap으로 레코드를 삽입하는 방법
clientclassesunit과는 별도로 clientide의 clientdatamodule에 sqlconnection이 있습니다. 삽입 SQL 문을 사용하여 wuth에 SQLQuery를 적용하려고했으나 기능이 작동하지 않습니다. 내가 서버 측에있는 다른 한강
: 내가 삽입하려고이 방법
procedure TServerMethods1.nuevocheque(idcliente,numero,cuenta,idbanco : integer; fr,fc, titular:string ;importe:Double;cobrado:Boolean);
var
ucheque:integer;
begin
with qicheque do
begin
Open;
ParamByName('idcliente').AsInteger:=idcliente;
ParamByName('numero').AsInteger:=numero;
ParamByName('fr').AsDate:=StrToDate(fr);
ParamByName('fc').AsDate:=StrToDate(fc);
ParamByName('importe').AsFloat:=importe;
ParamByName('titular').AsString:=titular;
ParamByName('cobrado').AsBoolean:=cobrado;
ParamByName('cuenta').AsInteger:=cuenta;
ExecSQL();
end;
end;
는 문은 구성 요소의 SQL 속성에 있습니다.
procedure TForm4.BGuardarClick(Sender: TObject);
var
idcliente,numero,cuenta,idbanco:integer;
titular:string;
cobrado:Boolean;
fr,fc:string;
importe:Double;
begin
ClientModule1.nuevocheque.Create(nil);
with ClientModule1.nuevocheque do
begin
idcliente:=1;
numero:=StrToInt(ENumero.Text);
cuenta:=StrToInt(Ecuenta.Text);
idbanco:=1;
titular:=ENombre.Text;
cobrado:=False;
importe:=StrToFloat(EMonto.Text);
fr:=EFechaEmision.Text;
fc:=EFechacobro.Text;
end;
end;
하지만 나던 기능 : 클라이언트 측에
, 나는 TSqlServerMethod는 느릅 나무 통화 "nuevocheque"가. 도움을 주셔서 감사합니다
코드에서 'Open' 호출을 제거하십시오. 'qicheque'가 준비된 SQL 문을 포함하고 있다면, params를 채우고'ExecSQL'을 호출하십시오. – TLama
어떤 서버 백엔드, MS Sql Server, MySql 등을 사용하고 있습니까? – MartynA
MySQL, 나는 워크 벤치를 가지고있다 – user3780282