var
var
studno:Integer;
begin
studno:=strtoint(edit1.text);
datamodule9.Query1.SQL.Clear;
datamodule9.Query1.SQL.Add('select bookid,borrowtime,returntime,delayed from borrowrecord where studentNo='''+studno+'''');
^^^Studno是数字,怎么能进行字符相加。直接换Edit1.Text不就行了
datamodule9.Query1.Open;
var
studno:Integer;
begin
studno:=strtoint(edit1.text);
datamodule9.Query1.SQL.Clear;
datamodule9.Query1.SQL.Add('select bookid,borrowtime,returntime,delayed from borrowrecord where studentNo='''+studno+'''');
^^^Studno是数字,怎么能进行字符相加。直接换Edit1.Text不就行了
datamodule9.Query1.Open;
如直接用edit1.text
也出错,数据类型不一样
var
studno:Integer;
begin
datamodule9.Query1.SQL.Clear;
datamodule9.Query1.SQL.Add('select bookid,borrowtime,returntime,delayed from borrowrecord where studentNo='+edit1.text);
datamodule9.Query1.Open;
end;
studno不是字符型,用不着'''
这样写我想应该可以:
datamodule9.Query1.SQL.Add('select bookid,borrowtime,returntime,delayed from borrowrecord where studentNo='+inttostr(studno)+);
studno不是字符型,用不着'''
这样写我想应该可以:
datamodule9.Query1.SQL.Add('select bookid,borrowtime,returntime,delayed from borrowrecord where studentNo='+inttostr(studno));