Problem connecting Lazarus with oracle 11g XE lazarus / 16-Databases ---------------------------------------------------------------------- wgandalf · 2012-11-22 01:38 I've tried to connect oracle with lazarus and I this error appeared: oracleconnection1: The creation of an oracle environment failed Lazarus: v 1.0.2 Version FPC: 2.6.0 Oracle 11g XE 11.2.0 Windows XP SP3 32B. procedure TForm1.Button1Click(Sender: TObject); begin   with OracleConnection1 do   begin     directory := directorio.Text;     hostname := '';     Databasename :=  host.Text+':'+puerto.Text+'/'+sid.Text;//'localhost:1521/xe';     Connected := true;   end;   if OracleConnection1.Connected then    showmessage('Conectado.');    sql.Active:=true; end; ---------------------------------------------------------------------- BigChimp · 2012-11-22 07:31 2 remarks: 1. Are your connection parameters correct (e.g. are you sure you don't need to fill in hostname, even 127.0.0.1 or localhost?) 2. Is your Oracle driver installed and working? Can you e.g. connect with sql*plus? ---------------------------------------------------------------------- wgandalf · 2012-11-22 12:49 1. Are your connection parameters correct (e.g. are you sure you don't need to fill in hostname, even 127.0.0.1 or localhost?)   I don't know its my first time with lazarus and oracle. I found this code and some similar. 2. Is your Oracle driver installed and working? Can you e.g. connect with sql*plus?  Oracle Drivers work. Yes, sqlplus work. sorry for my English. ---------------------------------------------------------------------- wgandalf · 2012-11-22 12:51 Probe with multiple servers I have and always returns the same error ---------------------------------------------------------------------- BigChimp · 2012-11-22 14:37 Well, given the example in FPC's database.ini.txt template file for the sqldb test framework, I would use the Hostname property and specify 127.0.0.1, possibly followed by : if that isn't 1521. The databasename may be the SID, don't know exactly. xe is what is mentioned in the database.ini.txt as well which is presumably set up for an Oracle XE setup. ---------------------------------------------------------------------- denver · 2012-11-22 17:53 Quote from: BigChimp on November 22, 2012, 03:37:13 pm The databasename may be the SID, don't know exactly. xe is what is mentioned in the database.ini.txt as well which is presumably set up for an Oracle XE setup. Oracle' s databasename concept is different from MySQL, PostgreSQL..., you need to assign the access right for each user. I use ZeosLib to connect to Oracle 11g XE with the following setting ( Localhost ) : ZConnection1.DatabaseName := '127.0.0.1'  ; ZConnection1.Port : 1521 ; ZConnection1.HostName := '127.0.0.1' ; ZConnection1.UserName := 'yourusername' ; ZConnection1.Password := 'yourpassword' ; ZConnection1.Protocol := 'oracle' ; It work fine for me .... ---------------------------------------------------------------------- wgandalf · 2012-11-22 18:18 ok, i will googlear zeoslib. Thanks ---------------------------------------------------------------------- BigChimp · 2012-11-23 08:09 Yes, by all means Google another db library instead of following my suggestions with the library you have now. Then you'll probably copy/paste some code that won't quite work and you end up asking the same kind of questions I'm giving up. (Glad I didn't spend any effort in e.g. converting a demo app to Oracle as I had done before) @denver: I don't know what you mean by your database name remark - but it's not relevant now anyway... ---------------------------------------------------------------------- denver · 2012-11-23 11:34 Oracle use the concept of workspace instead of database, so databasename is not valid in ZConnection1.databasename. Just put ZConnection1.DatabaseName := 'host ip address'  is ok. The workspace concept make me crazy  when i start to work with oracle. ---------------------------------------------------------------------- BigChimp · 2012-11-23 12:32 Workspace? No idea what you mean by that, but haven't kept track since 10g. Instance/sid, schema & database: yes. Workspace? No. Anway, feel free to update http://wiki.lazarus.freepascal.org/oracle with a zeos and/or sqldb section if you want to, that will certainly help. Regarddless, I'm sure Zeos' Zconnection.databasename is different from sqldb's toracleconnection.databasename...