假如你的A表是有 ID,NAME,OTHER1,OTHER2四个列adoquery1.sql.text:= 'insert into B select ID,'''+edit1.text+''',OTHER1,OTHER2 from A where ...
不对啊,是不是因为是ACCESS数据库问题?
access也是可以用这样的语句的或者你再试试adoquery1.sql.clear; adoquery1.sql.text:= 'insert into B select ID,'''+edit1.text+ ''',OTHER1,OTHER2 from A where [ID] = '''+edit2.text+''''; adoquery1.execsql;
insert into B select id,:aa,other from A where id=:bb
3楼的基本上差不多了. 补充一点.Insert into B (col1, col2, col3, name, col4, col5) // !!! 要指定B表的列名 !!! select s1, s2, s3, '相应的值' as name, s4, s5 from A where ID=:bb
update B set name=:aa where ID=:bb
不对啊,是不是因为是ACCESS数据库问题?
adoquery1.sql.text:= 'insert into B select ID,'''+edit1.text+
''',OTHER1,OTHER2 from A where [ID] = '''+edit2.text+'''';
adoquery1.execsql;
insert into B select id,:aa,other from A where id=:bb
select s1, s2, s3, '相应的值' as name, s4, s5 from A where ID=:bb