删除操作
...
with
ADOConnection do
begin
connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Access数据库路径地址 ;Persist Security Info=True'
LoginPrompt:=false;
end;
with
AdoQuery do
begin
Adoquery.close;
Adoquery.connection:=adoconnection;
Adoquery.sql.clear;
Adoquery1.sql.add('delete 表1 where id=:id');
parameters.parambyname('id'):=id号
ExecSQL; //查询使用Open、添加、删除、修改使用ExecSQL命令
end;
...
删除操作
...
with
ADOConnection do
begin
connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Access数据库路径地址 ;Persist Security Info=True'
LoginPrompt:=false;
end;
with
AdoQuery do
begin
Adoquery.close;
Adoquery.connection:=adoconnection;
Adoquery.sql.clear;
Adoquery1.sql.add('delete 表1 where id=:id');
parameters.parambyname('id'):=id号
ExecSQL; //查询使用Open、添加、删除、修改使用ExecSQL命令
end;
...
删除操作
...
with
ADOConnection do
begin
connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Access数据库路径地址 ;Persist Security Info=True'
LoginPrompt:=false;
end;
with
AdoQuery do
begin
Adoquery.close;
Adoquery.connection:=adoconnection;
Adoquery.sql.clear;
Adoquery1.sql.add('delete 表1 where id=:id');
parameters.parambyname('id'):=id号
ExecSQL; //查询使用Open、添加、删除、修改使用ExecSQL命令
end;
...
删除操作
...
with
ADOConnection do
begin
connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Access数据库路径地址 ;Persist Security Info=True'
LoginPrompt:=false;
end;
with
AdoQuery do
begin
Adoquery.close;
Adoquery.connection:=adoconnection;
Adoquery.sql.clear;
Adoquery1.sql.add('delete 表1 where id=:id');
parameters.parambyname('id'):=id号
ExecSQL; //查询使用Open、添加、删除、修改使用ExecSQL命令
end;
...
删除操作
...
with
ADOConnection do
begin
connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Access数据库路径地址 ;Persist Security Info=True'
LoginPrompt:=false;
end;
with
AdoQuery do
begin
Adoquery.close;
Adoquery.connection:=adoconnection;
Adoquery.sql.clear;
Adoquery1.sql.add('delete 表1 where id=:id');
parameters.parambyname('id'):=id号
ExecSQL; //查询使用Open、添加、删除、修改使用ExecSQL命令
end;
...
插入操作
...
with
ADOConnection do
begin
connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Access数据库路径地址 ;Persist Security Info=True'
LoginPrompt:=false;
end;
with
AdoQuery do
begin
Adoquery.close;
Adoquery.connection:=adoconnection;
Adoquery.sql.clear;
Adoquery1.sql.add('insert 表1(字段名) values(字段值)');
ExecSQL; //查询使用Open、添加、删除、修改使用ExecSQL命令
end;
...
...
with
ADOConnection do
begin
connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Access数据库路径地址 ;Persist Security Info=True'
LoginPrompt:=false;
end;
with
AdoQuery do
begin
Adoquery.close;
Adoquery.connection:=adoconnection;
Adoquery.sql.clear;
Adoquery1.sql.add(select * from 表1 where id=:id);
parameters.parambyname('id'):=id号
open;
end;
...
类似于
with ADOQuery_qtxf_hy do
begin
Close;
SQL.Add('select * from liandongxf where kahao=:kahao and jsbh=:hsbh');
Parameters.ParamByName('kahao').Value:=Trim(Edit_kahao.Text);
Parameters.ParamByName('jsbh').Value:=jsbh;
Open;
end;