#1 2016-08-19 01:23:06

ken
Member
Registered: 2016-07-15
Posts: 9

How to connect oracle by SynDBOracle

procedure TForm1.btn1Click(Sender: TObject);
var
  Lv_Rows : ISQLDBRows;
begin
  Lv_Rows := fProps.Execute('select * from dual',[],nil); //here has error. Error message is "TSQLDBOracleLib error:"
  while Lv_Rows.Step do
    mmo1.Lines.Add(ColumnString(0));
end;

initialization
   fProps := TSQLDBOracleConnectionProperties.Create('//192.168.1.221:1521/mes','','userid','pwd');

finalization
  fProps.free;

OCI.dll is in the same directory with the application.

Offline

#2 2016-08-19 07:07:45

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,667
Website

Re: How to connect oracle by SynDBOracle

What is the exact error?
Did you try with a TNS name?
Where did you get your oci.dll? Is it with the same 32-bit platform than your executable?
See http://synopse.info/files/html/Synopse% … l#TITL_117

Offline

#3 2016-08-23 10:08:06

ken
Member
Registered: 2016-07-15
Posts: 9

Re: How to connect oracle by SynDBOracle

Thank you for your help!
I didn't install Oracle client. I can run now.

But several conditions must be met:
1 Executable file must be 32 bits.
2 In the directory with the executable,must contain four files :oci.dll,oraociei12.dll,oraons.dll,msvcr100.dll.

Offline

#4 2016-08-24 13:56:44

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,667
Website

Re: How to connect oracle by SynDBOracle

Note that the SynDBOracle class would also work with the "light" client, named Instant Client.
See http://synopse.info/files/html/Synopse% … l#TITL_179

Offline

Board footer

Powered by FluxBB