Problem with Delphi + Zeos + MySQL/Oracle
Moderators: gto, cipto_kh, EgonHugeist
Problem with Delphi + Zeos + MySQL/Oracle
Hi guys. Sorry about my english. It is not one of the best, i am brasilian.
I am with a problem.
I work with two databases, Oracle and Mysql and i need to connect the component ZConnection with the network ...
With ADO i used to fill the property HostName with the server name and works fine. But with ZConnection, not works.
It simply ignore the hostname and connect with my local database.
There is someone that can help me ?
I am with a problem.
I work with two databases, Oracle and Mysql and i need to connect the component ZConnection with the network ...
With ADO i used to fill the property HostName with the server name and works fine. But with ZConnection, not works.
It simply ignore the hostname and connect with my local database.
There is someone that can help me ?
Hello rchaves!
Welcome to Zeos Forum. Don't worry about your english, it's very good
About you problem, what version do you use? I've tested the latest Zeos versions with Interbase, Firebird, MySQL and PostgreSQL, all local and via network. And all of them worked right as I wanted to.
Properties you must fill in order to connect successfully:
Database (default: Empty) Used to tell which database the connection should connect to. It's database dependant. In Firebird/Interbase protocols, its a string with the full path, on server, of the database. In MySQL, PostgreSQL and possibly other, its the name of the database. In SQLite, its the full path to the database file. In ADO, its the connection string (?).
HostName (default: Empty) The host where the database is running. If its a local databse, you can use it empty, fill up the local loopback address (127.0.0.1 for IPV4, ::1 for IPV6) or even with your local network address (used to share the program over the network). It's database dependant.
Password (default: Empty) The password you use to connect to your database. It will be used when LoginPrompt is False.
Protocol (default: Empty) The protocol that will be used when trying to connect. The correct selection of protocol is important so the correct library will be loaded and other minor changes will take place. Actually, there are 26 different protocol Zeos can handle. Some of it work very good, and others not so good. Here's a list (taken with Zeos 6.6.2-BETA): (In need of more information about which protocol is broken.)
TransactIsolationLevel (default: tiNone) Here you can select the Isolation Level that will be used withing Zeos transactions. It's database dependant, as some DBs don't support all of them. The current options are:
User (default: Empty) Username that will be used to connect to database. Used when LoginPrompt is False.
This information and a little more you can read in my Quick 'n Dirty Start Guide (work in progress):
http://zeos.firmos.at/viewtopic.php?t=1317
Welcome to Zeos Forum. Don't worry about your english, it's very good
About you problem, what version do you use? I've tested the latest Zeos versions with Interbase, Firebird, MySQL and PostgreSQL, all local and via network. And all of them worked right as I wanted to.
Properties you must fill in order to connect successfully:
Database (default: Empty) Used to tell which database the connection should connect to. It's database dependant. In Firebird/Interbase protocols, its a string with the full path, on server, of the database. In MySQL, PostgreSQL and possibly other, its the name of the database. In SQLite, its the full path to the database file. In ADO, its the connection string (?).
HostName (default: Empty) The host where the database is running. If its a local databse, you can use it empty, fill up the local loopback address (127.0.0.1 for IPV4, ::1 for IPV6) or even with your local network address (used to share the program over the network). It's database dependant.
Password (default: Empty) The password you use to connect to your database. It will be used when LoginPrompt is False.
Protocol (default: Empty) The protocol that will be used when trying to connect. The correct selection of protocol is important so the correct library will be loaded and other minor changes will take place. Actually, there are 26 different protocol Zeos can handle. Some of it work very good, and others not so good. Here's a list (taken with Zeos 6.6.2-BETA): (In need of more information about which protocol is broken.)
TransactIsolationLevel (default: tiNone) Here you can select the Isolation Level that will be used withing Zeos transactions. It's database dependant, as some DBs don't support all of them. The current options are:
User (default: Empty) Username that will be used to connect to database. Used when LoginPrompt is False.
This information and a little more you can read in my Quick 'n Dirty Start Guide (work in progress):
http://zeos.firmos.at/viewtopic.php?t=1317
gto ... thanks about the answer ...
but i've tested this and still not works...
i've put this code on the event before connect of zconnection ...
with cnnDados do
begin
Port := 1521;
Database := '';
HostName := 'bti01';
Password := 'bdbti';
Protocol := 'oracle-9i';
User := 'bdbti';
end;
Even filling in order zconnection still connects locally ...
ps: I'm trying to connect with oracle 10g
but i've tested this and still not works...
i've put this code on the event before connect of zconnection ...
with cnnDados do
begin
Port := 1521;
Database := '';
HostName := 'bti01';
Password := 'bdbti';
Protocol := 'oracle-9i';
User := 'bdbti';
end;
Even filling in order zconnection still connects locally ...
ps: I'm trying to connect with oracle 10g
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
It should, but let's start with the easiest... If it works for mysql we'll do Oracle. To make you comfortable, I used both 2 days ago, Oracle remote and mysql local.
My advise : if you have a problem start from zero. (= 1 single, database/server:form/component/...) if you understand that situation, all complex situations follow in (almost) no time...
My advise : if you have a problem start from zero. (= 1 single, database/server:form/component/...) if you understand that situation, all complex situations follow in (almost) no time...
my server ip is 192.168.1.8, the port is 1521
folowing my tnsnames.ora file
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
folowing my tnsnames.ora file
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)