没
没理头号
Unregistered / Unconfirmed
GUEST, unregistred user!
adoquery出错,这是为什么啊?
下面代码出错,为什么?
var
fQuery:TAdoquery;
begin
...
fsql := 'select * from logTable where ClientID=' + Client_IDList + ' and NDate='
+ #39 + cd + #39;
with fQuery do
begin
close;
sql.Clear;
sql.Add(fsql);
open;
if (RecordCount <= 0) then
//没有这天的记录
begin
fsql := 'insert into logtable(ClientID,NDate,IsNormal';
for j := 0 to ACheckDataID.Count - 1 do
fsql := fsql + ',' + ACheckDataID[j];
fsql := fsql + ') values(';
fsql := fsql + Client_IDList + ',' + #39 + cd + #39 + ',' + #39 + '否' + #39;
for j := 0 to ACheckDataID.Count - 1 do
fsql := fsql + ',' + #39 + '否' + #39;
fsql := fsql + ')';
close;
sql.Clear;
sql.Add(fsql);
execsql;//这里出错,说什么非法访问msado.dll什么的
end;
end;
...
end;
下面代码出错,为什么?
var
fQuery:TAdoquery;
begin
...
fsql := 'select * from logTable where ClientID=' + Client_IDList + ' and NDate='
+ #39 + cd + #39;
with fQuery do
begin
close;
sql.Clear;
sql.Add(fsql);
open;
if (RecordCount <= 0) then
//没有这天的记录
begin
fsql := 'insert into logtable(ClientID,NDate,IsNormal';
for j := 0 to ACheckDataID.Count - 1 do
fsql := fsql + ',' + ACheckDataID[j];
fsql := fsql + ') values(';
fsql := fsql + Client_IDList + ',' + #39 + cd + #39 + ',' + #39 + '否' + #39;
for j := 0 to ACheckDataID.Count - 1 do
fsql := fsql + ',' + #39 + '否' + #39;
fsql := fsql + ')';
close;
sql.Clear;
sql.Add(fsql);
execsql;//这里出错,说什么非法访问msado.dll什么的
end;
end;
...
end;