with ADOQuery1 do
begin
Close;
SQL.Clear;
sLan:='Insert into data (Date) VALUES (' ;
sLan:=sLan+'#2006-10-3#'
+')';
SQL.Add(sLan);
ExecSQL;
Close;
end; 始终都要说,SQL语句出错
begin
Close;
SQL.Clear;
sLan:='Insert into data (Date) VALUES (' ;
sLan:=sLan+'#2006-10-3#'
+')';
SQL.Add(sLan);
ExecSQL;
Close;
end; 始终都要说,SQL语句出错
begin
Close;
SQL.Clear;
SQL.Add('insert into table(rq) values(:#rq)');
Parameters.ParamByName('#rq').Value := FormatDateTime('yyyy-mm-dd',Date);
ExecSQL;
end;
一般的方法就是上面的注意你sLan:='Insert into data (Date) VALUES (' ;字段名不要用到关键字,如果用到了用[]括起来
begin
Close;
SQL.Clear;
sLan:='Insert into data (Date) VALUES (' ;
sLan:=sLan+'#2006-10-3#'
+')';
SQL.Add(sLan);//---->此处设置断点,把sql语句拿出来放到access中执行看是否错误就知道了。
ExecSQL;
Close;
end;