BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: woravet ที่ มิถุนายน 07, 2011, 17:31:11 PM
-
procedure MainForm.FormShow(Sender: TObject);
var
opdscreen_cds: TClientDataSet;
cds:Tclientdataset;
begin
fvn := trim(Getglobalvalue('VN'));
fptname := getsqldata('select concat(p.pname,p.fname," ",p.lname) '+
' as name '+
' from patient p '+
' left outer join ovst o on o.hn = p.hn '+
' where o.vn ="'+fvn+'" ');
ptname.text := fptname;
ptname1.caption := fptname;
opdscreen_cds.data := HOSxP_GetDataSet('select * from opdscreen where vn = "'+fvn+'" ');
txtfbs.text :=opdscreen_cds['fbs'].value;
end;
แล้วขึ้น error ว่า Record, object or class type required. แก้ไขอย่างไรครับ
-
ลองแบบนี้ ได้ไหมครับ
procedure MainForm.FormShow(Sender: TObject);
var
opdscreen_cds: TClientDataSet;
cds:Tclientdataset;
begin
opdscreen_cds:=tclientdataset.create(nil);
cds:=tclientdataset.create(nil);
fvn := trim(Getglobalvalue('VN'));
fptname := getsqldata('select concat(p.pname,p.fname," ",p.lname) '+
' as name '+
' from patient p '+
' left outer join ovst o on o.hn = p.hn '+
' where o.vn ="'+fvn+'" ');
ptname.text := fptname;
ptname1.caption := fptname;
opdscreen_cds.data := HOSxP_GetDataSet('select * from opdscreen where vn = "'+fvn+'" ');
txtfbs.text :=opdscreen_cds['fbs'].value;
end;
หรือไม่ก็ลาก clientdataset มาใส่ใน design form ตอนออกแบบฟอร์มครับ
แล้วในนี้ไม่ต้อง ใส่ opdscreen_cds: TClientDataSet;
cds:Tclientdataset;
ถ้ากอบปี้ Pas / Dfm มาให้จะแก้ไขได้ตรงครับ อันนี้ ต้องไปลองดูครับ