红色的是提示出错的地方
const arro :Array [1..8] of string = ('id1','id2','id3','id4','id5','id6','id7','id8');
var tempInt:string;
tempint1:string;
i:integer;
j:integer;
ArrT :Array [1..8,1..8] of string;
begin
for i:=1 to 8 do
begin
for j:=1 to 8 do
begin
ArrT[i,j]:=('+arro[i]+'+'+arro[j]+');
tempint1:=arro[i];
tempint:=arro[j];
with adoquery1 do
begin
close;
sql.Clear;
sql.add('insert into '+edit1.text+'(item ,num) select "arrt[i,j]", sum(tempint) from test where tempint1=1 and tempint=1');
adoquery1.Parameters.ParamByName('tempint').Value := tempint;
adoquery1.Parameters.ParamByName('tempint1').Value := tempint1;
open;
end;
end;
end;
end;
const arro :Array [1..8] of string = ('id1','id2','id3','id4','id5','id6','id7','id8');
var tempInt:string;
tempint1:string;
i:integer;
j:integer;
ArrT :Array [1..8,1..8] of string;
begin
for i:=1 to 8 do
begin
for j:=1 to 8 do
begin
ArrT[i,j]:=('+arro[i]+'+'+arro[j]+');
tempint1:=arro[i];
tempint:=arro[j];
with adoquery1 do
begin
close;
sql.Clear;
sql.add('insert into '+edit1.text+'(item ,num) select "arrt[i,j]", sum(tempint) from test where tempint1=1 and tempint=1');
adoquery1.Parameters.ParamByName('tempint').Value := tempint;
adoquery1.Parameters.ParamByName('tempint1').Value := tempint1;
open;
end;
end;
end;
end;
解决方案 »
- 请帮我看下这个查询该乍样写?
- Delphi擂台赛新鲜出炉
- 繁体网页的问题
- 极简单的问题,RichEdit中如何删除文字。
- 内嵌汇编如何使用 fword ptr ?
- sqlserver两个表中的求和问题,在线等待。。。
- 没安装visio的情况下,怎么编程打开visio格式的文件〔在线等待,十万火急)
- 紧急求救,[Fatal Error] company_Unit.pas(88): Line too long (more than 1023 characters),使编译中断
- 如何获取本机现在时间,急,马上给分,
- 调查一下,各位同仁知道在北京unix系统的程序员每月能拿多少钱吗?
- blazingfire领分
- deiphi关于listbox的问题
...
:tempint1 = 1 and tempint = 1
颜色用错了
加:是当参数使用,后面再赋值,一般在SQL语句中常用到sql.add('insert into '+edit1.text+'(item ,num) select '''+arrt[i,j]+''', sum(:tempint) from test where :tempint1=1 and :tempint=1' group by '+arrt[i,j]+');
sql.add('insert into '+edit1.text+'(item ,num) select '''+arrt[i,j]+''', sum(:tempint) from test where :tempint1=1 and :tempint=1 group by '+arrt[i,j]+'');