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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:00:49+00:00 2026-05-26T12:00:49+00:00

I am working with multiple databases within the same application. I am using drivers

  • 0

I am working with multiple databases within the same application. I am using drivers from two different companies. Both companies have tTable and tQuery Descendants that work well.

I need a way to have generic access to the data, regardless of which driver/tQuery component I am using to return a set of data. This data would NOT tie to components, just to my logic.

For example…(pseudocode) Let’s create a function which can run against either tQuery component

function ListAllTables(NameOfDatabase : String) :ReturnSet??
begin

If NameOfDataBase = 'X' then use tQuery(Vendor 1)
    else use tQuery(Vendor 2)
RunQuery;
Return Answer...
end;

When NORMALLY running a query, I do

Query.Open;
While not Query.EOF do
   begin
   Read my rows..
   next;
end;

If I am CALLING ListAllTables, what is my return type so that I can iterate through the rows? Each tQuery Vendor is different, so I can’t use that (can I, and if so, would I want to?) I could build a Memory Table, and pass that back, but that seems like extra work for ListAllRows to build a memory table, and then to pass it back to the calling routine so that it can “un-build”, i.e. iterate through the rows…

What are your ideas and suggestions?
Thanks
GS

  • 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-26T12:00:50+00:00Added an answer on May 26, 2026 at 12:00 pm

    Almost all Delphi datasets descend from TDataset, and most useful behavior is defined on TDataset.

    Therefore, if you assign each table or query to a variable of type TDataset, you should be able to perform your logic on that dataset in a vendor neutral fashion.

    I would also isolate the production of the datasets into a set of factory functions that only create the vendor-specific dataset and return it as a TDataset. Each factory function goes in it’s own unit. Then, only those small units need have any knowledge of the vendor specific components.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with multiple databases in a PHP/MySQL application. I have development, testing,
With multiple developers working on the same Tomcat application, I'd like to tell the
I have an application which needs to connect to multiple databases. This is an
I am working on Zend Framework and using module based structure with multiple databases.
Currently working on a bespoke ecommerce application using Codeigniter. I have a products table
I have an SQL database with multiple tables, and I am working on creating
If I have multiple SVN working copies checked out to my local PC, what's
I have a show/hide toggle working well in multiple instances (thanks to help here
I'm running backups against multiple databases hosted at Rackspace. This is working fine. The
I have a web application at work that is similar to a ticket working

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.