Help Updating Database
Posted: Mon 09 Jul 2007 15:23
I'm using Delphi 2006 and SDAC for SQL 2000 v4.00.0.4
I run a TMSQuery that returns data to a grid from 2 tables for viewing only.
If data needs to be updated, on one table only, a Execute a TMSSQL with the following code in the SQL property of the TMSSQL:
Use LamTest
Update OpenJob
Set SalesmanN = :SalesmanN
where
SalesManN = :SalesmanNB
then call it like this:
MSQuery1.Close;
with MSSQL1 do
begin
Close;
Prepared;
Params[0].value := StrToInt(Edit1.Text);
Params[1].value := StrToInt(Edit2.Text);
Execute;
But it doesn't update anything. If I use SQL Analizer and run the SQL code there it works.
I'm using the right components? How do I update records, from one to hundreds?
Thanks
I run a TMSQuery that returns data to a grid from 2 tables for viewing only.
If data needs to be updated, on one table only, a Execute a TMSSQL with the following code in the SQL property of the TMSSQL:
Use LamTest
Update OpenJob
Set SalesmanN = :SalesmanN
where
SalesManN = :SalesmanNB
then call it like this:
MSQuery1.Close;
with MSSQL1 do
begin
Close;
Prepared;
Params[0].value := StrToInt(Edit1.Text);
Params[1].value := StrToInt(Edit2.Text);
Execute;
But it doesn't update anything. If I use SQL Analizer and run the SQL code there it works.
I'm using the right components? How do I update records, from one to hundreds?
Thanks