I need to Join 2 databases, I am using delphi and the zeos lib.
The reason: my client has an application wich manages their vacations and which is saved in the first database, now I shall write a programm wich uploads the vacations in an exchange server.
but to know wich vacation I already updated I made a second database to compare both.
One problem might be that the name of the database is the ip adreddess.
Queries like this work:
(It does not include the second database yet)
select ur_id as m_id
, dbo.urlaub.ur_status as m_status
, dbo.urlaub.ur_start as m_start
, dbo.urlaub.ur_end as m_end
, dbo.urlaub.ur_description as m_description
from dbo.urlaub
inner join dbo.users
on dbo.urlaub.ur_user_id = dbo.users.id;
Queries like this does not work:
(Includes the second database)
(It works in the database programm but not in my programnm)
select m_urlaub.ur_id as m_id
, m_urlaub.ur_status as m_status
, m_urlaub.ur_start as m_start
, m_urlaub.ur_end as m_end
, m_urlaub.ur_description as m_description
, ex_urlaub.ur_status as ex_status
from kalender.dbo.urlaub as m_urlaub
inner join kalender.dbo.users as m_users
on m_urlaub.ur_user_id = m_users.id
full outer join exchangerelation.dbo.urlaub as ex_urlaub
on ex_urlaub.ur_id = m_urlaub.ur_id;
(This is only an example what does work and whatnot, not my real querie, only one wich I used to test if everything works)
I get to work with SSMS as database for this project.
I alwasy get the “EZSQLException”: [15250]
The database name component of the object qualifier must be the name of the current database.
The database has already a lot of data saved, so it would not be nice if my programm need to sort every data.
(Both Database use the same server, port, username, password)
(the only differenze is their name:
db1: kalender
db2 exchangerelation)
Do I need to use TZGroupedConnection or TZConnectionGroup?
(I tried to change the databasename in the TZConnection to IP of database (which should also be teir name), kalender, exchangerelation, master (also everything with “/” and “”))
Sadly I didn’t found a good explanation about both TZ…, or how to Join multiple databases with zeos.
Sorry if I did’t post the right way or anything, this is my first question in the forum (until now I somehow found answers elswhere without the need to ask them myself).
Ultimate Chaos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1