笨
笨笨的小孩
Unregistered / Unconfirmed
GUEST, unregistred user!
部分代码如下:
procedure DBOperation.ClearDB(AQuery1: TADOQuery;
AQuery2: TADOQuery;
Aselected: String);
var
sqlStr: String;
begin
sqlStr := 'Delete from EachYear where (YProjectID = '''+ Aselected +''')';
AddToDB2(AQuery2, sqlStr);
SqlStr := 'Delete from ProjectLoan where (projectID = '''+ Aselected + ''')';
AddToDB2(AQuery1, sqlStr);
sqlStr := 'select * from ProjectLoan order by ProjectID';
AddToDB1(AQuery1, sqlStr);
end;
procedure DBOperation.AddToDB1(AQuery: TADOQuery;AsqlStr: string);
begin
with AQuerydo
begin
close;
sql.Clear;
sql.Add(AsqlStr);
open;
end;
end;
procedure DBOperation.AddToDB2(AQuery: TADOQuery;AsqlStr: string);
begin
with AQuerydo
begin
close;
sql.Clear;
sql.Add(AsqlStr);
ExecSql;
end;
end;
为什么执行后会报标准表达式中数据类型不匹配呢? 我不知道什么原因,请各位能指教.
procedure DBOperation.ClearDB(AQuery1: TADOQuery;
AQuery2: TADOQuery;
Aselected: String);
var
sqlStr: String;
begin
sqlStr := 'Delete from EachYear where (YProjectID = '''+ Aselected +''')';
AddToDB2(AQuery2, sqlStr);
SqlStr := 'Delete from ProjectLoan where (projectID = '''+ Aselected + ''')';
AddToDB2(AQuery1, sqlStr);
sqlStr := 'select * from ProjectLoan order by ProjectID';
AddToDB1(AQuery1, sqlStr);
end;
procedure DBOperation.AddToDB1(AQuery: TADOQuery;AsqlStr: string);
begin
with AQuerydo
begin
close;
sql.Clear;
sql.Add(AsqlStr);
open;
end;
end;
procedure DBOperation.AddToDB2(AQuery: TADOQuery;AsqlStr: string);
begin
with AQuerydo
begin
close;
sql.Clear;
sql.Add(AsqlStr);
ExecSql;
end;
end;
为什么执行后会报标准表达式中数据类型不匹配呢? 我不知道什么原因,请各位能指教.