Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6643791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:05:30+00:00 2026-05-26T00:05:30+00:00

In a Delphi application which uses TADODataSet components to access to an Access database,

  • 0

In a Delphi application which uses TADODataSet components to access to an Access database, there is any way to delete leading and trailing spaces from text fields when record is written to disk? or perhaps when retrieving the data, but without modifying all my queries.

I mean in ADO engine, without coding myself using Trim() in BeforePost on every table.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:05:31+00:00Added an answer on May 26, 2026 at 12:05 am

    With all the limitations you’ve put up… No

    My advice would be to code a BeforePost event just once and link all tables to the same beforepost event.

    In the objectinspector

    Table1.BeforePost:= TrimFieldsBeforePost;
    Table2.BeforePost:= TrimFieldsBeforePost;
    ....
    

    In your code

    procedure TMyForm.TrimFieldsBeforePost(DataSet: TDataSet);
    var
      i: integer;
    begin
      i:= 0;
      while i < Dataset.Fields.Count do begin
        if (Dataset.Fields[i].DataType in
          [ftString, FtMemo, ftFixedChar, ftWideString,FtVariant, ftFixedWideChar, ftWideMemo]) then begin
          Dataset.Fields[i].AsString:= Trim(Dataset.Fields[i].AsString);
        end;
        Inc(i);
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an application in Delphi which uses an SQLite3 database. I'd like to
Simple problem. I'm working on a Delphi 2007/WIN32 application which now uses MS Access
I'm building a multi-threaded windows service application in Delphi XE2 which uses ADO database
I built a Delphi-7 Windows Application which uses some web services. The application is
Background: I have an application written in Delphi that uses the Borland Database Engine
I have a Delphi application using DevExpress cxGrid (which is connected to database). I
I am using Delphi 7 on Windows 7 and have an application which uses
we have a delphi application which contains a TXTextControl (v. 13.0). This application uses
I'm working on a Delphi/WIN32 application that uses an SQL Server database as back-end,
Is there a way to get CreateOleObject to work in a Delphi Form Application?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.