Connect 4GL to Informix Server
Posted in 2013
Asker had I4GL on one (32-bit) machine and the Informix server on another (64-bit) and wanted to know how to supply a user/password for the connection, preferably without changing code. Answers: I4GL supports CONNECT TO 'dbase@server' USER ... USING ... (the MAIN module must not contain a non-procedural DATABASE statement). However, if the client machine/user is trusted (via ~/.rhosts or hosts.equiv) no credentials are needed — just set INFORMIXSERVER and use DATABASE or plain CONNECT. For 32-bit client to 64-bit server, use a network/stream-pipe connection in sqlhosts rather than shared memory. No final confirmation from the poster is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL, Security, Permissions & Auditing
Hello: I have a question again! If i have installed Informix 4GL in Server A and i want to connect it to Server B where is installed Informix server. Where specify name and password for user to connect to informix? Can i do this not in code? Thanks!!!
I'm not quite sure what you're asking, but I4GL supports the CONNECT statement. You can obtain the username and password strings from any source you choose. DEFINE username VARCHAR(32), password VARCHAR(32) ...set username, password CONNECT TO 'dbase@serverb' USER username USING password About the only trick is to ensure that the file containing the MAIN program does not include a non-procedural DATABASE statement (so no database is selected as the program starts up). Your program then calls a function (probably) to manage the CONNECT. This has been discussed before, either on this list or on the classics@iiug.org (but several years ago now, I think). On Thu, Jul 25, 2013 at 9:48 PM, LICU GARCIA <licu99@gmail.com> wrote: > Hello: > > I have a question again! > > If i have installed Informix 4GL in Server A and i want to connect it to > Server B where is installed Informix server. Where specify name and > password > for user to connect to informix? > Can i do this not in code? > > Thanks!!! > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h> Guardian of DBD::Informix - v2013.0521 - http://dbi.perl.org "Blessed are we who can laugh at ourselves, for we shall never cease to be amused." --047d7b3442aa52fc7504e2637c16
Ok, thanks Jonathan. I was wanting avoid this code because the context is: First, both 4gl and informix server were in the same server (32 bits) and the 4gl programs don't were having problems to connect to informix. But now, I have my 4gl programs in 32 bits server and Informix server is for a 64 bits server. I can't compile other time the 4gl programs and I am searching how establish connection in this schema, but for how you wrote, the solution is in the code. I'm sorry for my english. I only understand a little.
If the remote server is trusted, you do not need to specify user and password. If it is not, yes, you can use the CONNECT statement to connect using a username and password. Don't remember if 4GL supports CONNECT but you can execute it as a string. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, Jul 26, 2013 at 12:48 AM, LICU GARCIA <licu99@gmail.com> wrote: > Hello: > > I have a question again! > > If i have installed Informix 4GL in Server A and i want to connect it to > Server B where is installed Informix server. Where specify name and > password > for user to connect to informix? > Can i do this not in code? > > Thanks!!! > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --047d7b34419a61d70904e2691404
To connect a 32bit app to a 64bit server you just have to use a network or streampipe connection not a shared memory connection. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, Jul 26, 2013 at 1:55 AM, LICU GARCIA <licu99@gmail.com> wrote: > Ok, thanks Jonathan. > > I was wanting avoid this code because the context is: > > First, both 4gl and informix server were in the same server (32 bits) and > the > 4gl programs don't were having problems to connect to informix. But now, I > have my 4gl programs in 32 bits server and Informix server is for a 64 bits > server. I can't compile other time the 4gl programs and I am searching how > establish connection in this schema, but for how you wrote, the solution > is in > the code. > > I'm sorry for my english. I only understand a little. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --089e0141a9eaa306b404e269198e
Thanks.
I have my sqlhosts file in both, 4gl programs and informix server:
ol_resp onsoctcp 192.168.1.122 ol_service
Thanks. I have the remote server trusted, but there are any others configurations? Because if i do this (for example): ssh informix@192.168.1.122 the password is required.
Investigate: ~/.rhosts Or hosts.equiv Sent from my iPhone On 26/07/2013, at 11:08 PM, "LICU GARCIA" <licu99@gmail.com> wrote: > Thanks. > > I have the remote server trusted, but there are any others configurations? > Because if i do this (for example): > ssh informix@192.168.1.122 > the password is required. > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. >
Nothing, as long as the two servers are trusted and the user running the application has a valid login on the server, a simple DATABASE statement or a CONNECT without a username and password will suffice. Just set INFORMIXSERVER to the appropriate server name and go. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, Jul 26, 2013 at 9:08 AM, LICU GARCIA <licu99@gmail.com> wrote: > Thanks. > > I have the remote server trusted, but there are any others configurations? > Because if i do this (for example): > ssh informix@192.168.1.122 > the password is required. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001a1133b7dac8a4c704e26a1809
Hello Licu, If you have difficulty understanding Informix-related English answers and topics, I can translate them for you to Spanish. I am fully bilingual and have been dealing with Informix ever since version 3.30 Hola Licu, Si tienes dificultad entendiendo respuestas y temas en Ingles relacionados a Informix, Yo te los puedo traducir a Español. Yo soy completamente bilingüe y he estado bregando con Informix desde la version 3.30