Re: Network connection.,,
Posted in 1997
You can check your connection by using dbaccess.
For each INFORMIXSERVER in your sqlhosts file, access the database via
dbaccess (i.e. dbaccess somedb@somehost). If this works, then you can try
running a very simple ESQL/C program such as the following:
#include <stdio.h>
$include sqlca;
void main(void)
{
$int num_tbls;
$connect to somedb@somehost;
if (sqlca.sqlcode < 0)
{
printf("sqlcode = %d\\n", sqlca.sqlcode);
exit(1);
}
$select count(*)
into $num_tbls
from systables
where tabid > 99
and tabtype = "T";
if (sqlca.sqlcode < 0)
{
printf("sqlcode = %d\\n", sqlca.sqlcode);
exit(1);
}
printf("Total tables in database = %d\\n", num_tbls);
}
This is a good ESQL/C test.
You should also check if your /etc/services file has the correct socket
port number and service that corresponds to your sqlhosts file.
If you need further help, please let me know.
Partha Dutta
Sr. Database Engineer
Pronet Communications
pdutta@airmail.net
pdutta@pronet1.com
thabib@bob.zentropy.softaware.com wrote in article
<5ps3u8$dh1@cssun.mathcs.emory.edu>...
> Hello all,
>
> I'm trying to connect to a INFORMIX-OnLine Version 7.12.UC1 (online
> dynamic server) with a esql/c application (INFORMIX-ESQL Version
7.12.UC1).
> I have doubled-checked the sqlhosts files, onconfig, hosts.equiv, hosts
> files, and restarted the database engine, only to get a -908 SQLCODE code
> returned... What am I forgetting?
>
> Is there any way to check if Informix is actually listening on a port
> besides using ESQL/C? And can i connect over a network by using infperl,
> or any other langauges? Any help would be greatly appreciated.
>
> Thanks,
>
> Tony Habib
>
>
> Tony Habib
> Software Developer, Zentropy Interactive
>
> thabib@zentropy.com
> thabib@cs.sci.csupomona.edu
> thabib@netroplex.com
>
> "Nothing travels faster than the speed of light, except for bad news
which
> obeys its own special laws."
> -- Douglas Adams, "Mostly Harmless"
>
>