F
feng2002
Unregistered / Unconfirmed
GUEST, unregistred user!
(1)如何用Query控件将EDIT中的值的插到ACCESS数据表中,并将有此值的记录插入到
另一新表,并将原表中有此值的记录删除,我已写了代码,但运行有错。
Query3.Close();
Query3.SQL.Clear();
Query3.SQL.Add("select from staffentry where No1=:Q18");
Query3.ParamByName("Q18").AsString=Edit18.Text;
Query3.Open();
Query3.Close();
Query3.RequestLive=true;
Query3.SQL.Clear();
Query3.SQL.Add("Insert into staffentry (left) Values (true)");
Query3.RequestLive=false;
Query3.Close();
Query3.RequestLive=true;
Query3.SQL.Add("Delete from staffentry where (Left='true')");
Query3.SQL.Add("select [Name1],[No1],[Age],[Salary],[Id],[Phone],[Intime],[Worktime],[Headname] into staffleft from staffentry where (left=true)");
if (!Query3.Prepared) Query3.Prepare();
Query3.ExecSQL();
(2)我想在DELPHI中实现将用户在EDIT中输入“入职时间“后,在另一EDIT中自动计算其“工龄”,并插入到ACCESS数据库中去?
另一新表,并将原表中有此值的记录删除,我已写了代码,但运行有错。
Query3.Close();
Query3.SQL.Clear();
Query3.SQL.Add("select from staffentry where No1=:Q18");
Query3.ParamByName("Q18").AsString=Edit18.Text;
Query3.Open();
Query3.Close();
Query3.RequestLive=true;
Query3.SQL.Clear();
Query3.SQL.Add("Insert into staffentry (left) Values (true)");
Query3.RequestLive=false;
Query3.Close();
Query3.RequestLive=true;
Query3.SQL.Add("Delete from staffentry where (Left='true')");
Query3.SQL.Add("select [Name1],[No1],[Age],[Salary],[Id],[Phone],[Intime],[Worktime],[Headname] into staffleft from staffentry where (left=true)");
if (!Query3.Prepared) Query3.Prepare();
Query3.ExecSQL();
(2)我想在DELPHI中实现将用户在EDIT中输入“入职时间“后,在另一EDIT中自动计算其“工龄”,并插入到ACCESS数据库中去?