title: Inserting current date and time into Access database
body: <p>I am trying to insert the current date and time into an Access database, using Delphi.</p>
  
  <p>The procedure I am using is as follows:</p>
  
  <pre><code>procedure WriteToDatabase;
    var
      TableName, DateTimeNow : string;
      GetCurrentDateTime : TDateTime;
    begin
      GetCurrentDateTime := Now; // The current date and time to write as the FuncID in the database;
      DateTimeNow := DateTimeToStr(GetCurrentDateTime);
      ShowMessage('The current date and time is: '+DateTimeNow);
      ConvertDateTimeForAccess(DateTimeNow);
      TableName := 'tblFunction';
      frmMain.ADOCommand.Connection := frmMain.ADOConnection;
      frmMain.ADOConnection.ConnectionString := 'Provider=Microsoft.ACE.OLEDB.12.0;Data Source='+
      DatabaseName+';';
      frmMain.ADOCommand.CommandText := 'INSERT INTO '+TableName+ ' VALUES ('+DateTimeNow+ 'y = 3x^2 + 4x + 4);';
      frmMain.ADOCommand.Execute;
    end;
  </code></pre>
  
  <p>Unfortunately I get an error when I run the program, namely, 'Parameter object is improperly defined. Inconsistent or incomplete information was provided'.</p>
  
  <p>Is the issue perhaps the formatting of the date? I did not think this was an issue however as I am entering it into the Database as a string type as opposed to a date.</p>
  
  <p>Can somebody please suggest what needs to be changed here?</p>