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 8298803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:55:02+00:00 2026-06-08T15:55:02+00:00

In my Question: How to use Sender parameter with As operator for more then

  • 0

In my Question:
How to use “Sender” parameter with “As” operator for more then one class at a time

I choose the Remy Lebeau’s Answer because it was the most dynamic tech for most situations like that. It uses the RTTI TypInfo Class.

But as I was using this class, another problem came:
How do we Set a sub-property value?

function TRemote.UpdateQuery(DataSet: TDataSet; SQL: String): Boolean;
var
  PropInfo: PPropInfo;
begin
{ atualiza o código SQL padrão de um dataSet de consulta tipo View }
  PropInfo := GetPropInfo(DataSet, 'SQL', []);
  if not Assigned(PropInfo) then
  begin
    Result := False;
    Exit;
  end;
  try
    DataSet.Close;
    SetPropValue(DataSet, PropInfo, SQL);
    DataSet.Open;
    Result := True;
  except
    Result := False;
  end;
end;

Example:
I have a TIBQuery and I want to update the text of the SQL property.
But the SQL property is a TStrings class, so I have to use SQL.Text.
In the code above, It will raise an error “Invalid Property Type” because I got a TStrings and later I try to Set a normal String.

How to reach the SQL.Text using GetPropInfo?
Is there a common ancestor of TIBQuery and TZQuery that has the SQL property, so I can change to, instead of the TDataSet in the function parameter?

  • 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-06-08T15:55:03+00:00Added an answer on June 8, 2026 at 3:55 pm

    The TStrings.Text property is not accessible via RTTI in Delphi 2006. Even if it were, you do not need to use RTTI to access it anyway. Since you know the SQL property is a TStrings object, you can simply retreive the actual object pointer from the property and type-cast it to a TStrings pointer, then you can do whatever you need to do with that object, eg:

    function TRemote.UpdateQuery(DataSet: TDataSet; SQL: String): Boolean; 
    var 
      PropInfo: PPropInfo; 
      SQLObj: TStrings;
    begin 
      Result := False; 
      try 
        PropInfo := GetPropInfo(DataSet, 'SQL', [tkClass]); 
        if not Assigned(PropInfo) then Exit; 
        SQLObj := TStrings(GetObjectProp(DataSet, PropInfo, TStrings));
        if not Assigned(SQLObj) then Exit; 
        DataSet.Close; 
        SQLObj.Text := SQL; 
        DataSet.Open; 
        Result := True; 
      except 
      end; 
    end; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question I use celery to launch task sets that look like this: I perform
QUESTION: Re use of .NET Backgroundworker, is there not a way to let exceptions
I have a question regarding use of FFT. Using function getBand(int i) with Minim
Similar, but different to this question : I use highlight occurrences a lot, but
Question: How to use ssh & scp from the Windows command prompt? I remember
I have question regarding the use of function parameters. In the past I have
i have an question how to use an alias column at the where/having clause.
I have a question about the use of multidimensional std::intializer_list in C++. I have
i have a question how to use an alias from a select query: $timecheck
I have a simple question: if I use URLConnection.setUseCaches(true) when loading something from web,

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.