Hi
I am pulling my hair out, I am trying to update a table using an ado query, I am using Delphi 5 as a front end and the DB is Access 2003, I have written the app in access and it works fine but I thought I would try to write a front end in Delphi. I will endeavour to explain what I am trying to do
I want to update two columns of dates (The data type is text)
The dates represent testing dates(LastTested and DueTesting)
The dates are 91 days appart
I want to update LastTested to the current date and DueTesting 91 days later
my coding idea is roughly as follows
I keep getting an error message that the parameter is incorrectly defined any help would be much appreciated. I have used the ParamsByName in the past with ADOQuerys but never as an update and never using multiple parametersCode:ADOConnection1.Connected :=True; With ADOQuery1 do begin SQL.Clear; SQL.Text :='Update MCPTestDetails Set LastTested := (:dteparam) and DueTesting := (:dteparam2) Where DueTesting = (;dteParam) '; Parameters.ParamByName('dteparam').Value := DateToStr(Monthcalendar1.Date); Parameters.ParamByName('dteparam2').Value := DateToStr((Monthcalendar1.Date)+91); ExecSQL; Post; close; end; ADOConnection1.Connected :=False;


LinkBack URL
About LinkBacks




Reply With Quote



Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum