I am trying to connect to a Oracel sql database, and this give me big trouble. I thing i have try everything without luck.
Is there a nice person who can give me a hist or an example?
Maby my problems is the Oracle driver, OCI.dll files??? and where to set port?
I have made a simpel code for test. This give me a "The creation of an Oracle environment failed." or "OCI.DLL_ERROR"
procedure TForm1.btConnectClick(Sender: TObject);
var
Conn : TOracleConnection;
Tran : TSQLTransaction;
Q : TSQLQuery;
begin
Try
try
Conn := TOracleConnection.Create(nil);
Tran := TSQLTransaction.Create(nil);
Q := TSQLQuery.Create(nil);
Conn.HostName := ''; //my ip, user, password and databasename.
Conn.UserName := '';
Conn.Password := '';
Conn.DatabaseName := '';
Conn.Connected := True;
Conn.Transaction := Tran;
Q.DataBase := Conn;
Conn.Open;
Tran.Active := true;
Q.SQL.Text := 'SELECT * From EditionView_SPR';
Q.Open;
Q.First;
while not (Q.EOF) do
begin
Memo1.Lines.Add('x');
Q.Next;
end;
Q.Close;
finally
Q.Free;
Tran.Free;
Conn.Free;
end;
except
on E: Exception do
Begin
Memo1.Lines.Add('Except fejl: ' + E.Message);
end;
end;
end;