Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Informix connection error


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jun 17, 2014 8:55 PM Last Post By: Dmitry Arefiev
Paulo Mariano

Posts: 29
Registered: 11/25/12
Informix connection error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 17, 2014 1:33 PM
Hello.

The code below, executed by an application built with Delphi XE5 and IBM Informix ODBC Driver x86, successfully connects to the database:

FDConnection := TFDConnection.Create(nil);
 
if FDManager <> nil then
  FDManager.Free;
if FDConnection <> nil then
  FDConnection.Free;
FDManager := TFDManager.Create(nil);
FDConnection := TFDConnection.Create(nil);
 
Params := TStringList.Create;
if (ParamCount > 0) and (Paramstr(1) <> '') then // server
  Params.Values['Database'] := Paramstr(1)
else
  Params.Values['Database'] := 'pos';
if (ParamCount > 1) and (Paramstr(2) <> '') then // database
  Params.Values['HostName'] := Paramstr(2)
else
  Params.Values['HostName'] := 'nwrc';
Params.Values['User_Name'] := Paramstr(3);
Params.Values['Password'] := Paramstr(4);
if (ParamCount > 2) and ((Paramstr(3) <> '') and (Paramstr(4) <> '')) then
  FDConnection.LoginPrompt := False
else
  FDConnection.LoginPrompt := True;
 
Params.Values['DriverID'] := 'Infx';
Params.Values['MetaDefSchema'] := 'informix';
FDConnection.ConnectionDefName := 'TestConnection';
FDManager.AddConnectionDef('TestConnection','Infx',Params);
FDManager.Connections[0].Connected := True;


The same code, executed by the same application built with Delphi XE6 and IBM Informix ODBC Driver x86, raises the following exception:
Project app.exe raised exception class EInfxNativeException with message '[FireDAC][Phys][ODBC][Informix][Informix ODBC Driver]General error.'

I would appreciate if some assistance could be provided.
Thank you in advance
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Informix connection error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 17, 2014 8:55 PM   in response to: Paulo Mariano in response to: Paulo Mariano
if (ParamCount > 0) and (Paramstr(1) <> '') then // server
Params.Values['Database'] := Paramstr(1)
else
Params.Values['Database'] := 'pos';
if (ParamCount > 1) and (Paramstr(2) <> '') then // database
Params.Values['HostName'] := Paramstr(2)
else
Params.Values['HostName'] := 'nwrc';

http://docwiki.embarcadero.com/RADStudio/XE6/en/Connect_to_Informix_(FireDAC)
* Database - not server, but database name.
* Server - not HostName and not database, but registered database server name.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02