complete examples of libpq applications in the
following directories:
-../src/test/regress
-../src/test/examples
-../src/bin/psql
-
+
+ src/test/examples
+ src/bin/psql
+
particular order, or at all, or on the status always being one of these
documented values. An application may do something like this:
- switch(PQstatus(conn))
- {
- case CONNECTION_STARTED:
- feedback = "Connecting...";
- break;
+switch(PQstatus(conn))
+{
+ case CONNECTION_STARTED:
+ feedback = "Connecting...";
+ break;
- case CONNECTION_MADE:
- feedback = "Connected to server...";
- break;
+ case CONNECTION_MADE:
+ feedback = "Connected to server...";
+ break;
.
.
.
- default:
- feedback = "Connecting...";
- }
+ default:
+ feedback = "Connecting...";
+}
At the bottom of axnet.cnf,
find the line that starts with
#libFor elfodbc /ax/...
-
+
Change line to read
libFor elfodbc applixroot/applix/axdata/axshlib/lib
-
+
which will tell elfodbc to look in this directory
for the
ODBC support library.
Create .odbc.ini as
described above. You may also want to add the flag
TextAsLongVarchar=0
-
+
to the database-specific portion of .odbc.ini
so that text fields will not be shown as **BLOB**.
- Select <command>Query->Choose Server>.
+ Select <menuchoice>QueryChoose Server>.
- Select <acronym>ODBC, and click Browse>.
+ Select <guimenuitem>ODBC, and click Browse>.
The database you configured in .odbc.ini
- should be shown. Make sure that the <option>Host: field
+ should be shown. Make sure that the <guilabel>Host: field
is empty (if it is not, axnet> will try to contact axnet> on another machine
to look for the database).
- Select the database in the box that was launched by <command>Browse>,
- then click <command>OK>.
+ Select the database in the box that was launched by <guibutton>Browse>,
+ then click <guibutton>OK>.
Enter user name and password in the login identification dialog,
- and click <command>OK>.
+ and click <guibutton>OK>.
- You should see <literal>Starting elfodbc serverl>
+ You should see <guilabel>Starting elfodbc serverl>
in the lower left corner of the
data window. If you get an error dialog box, see the debugging section
below.
- Select a table from Query->Choose tables, and then select Query->Query
- to access the database. The first 50 or so rows from the table should
- appear.
+ Select a table from
+ Query>Choose
+ tables>, and then select
+ Query>Query>
+ to access the database. The first 50 or so rows from the table
+ should appear.
The driver process has terminated due to some other
problem. You might not have an up-to-date version
the axnet process. For example, if
-% ps -aucx | grep ax
- >
+>
+>
shows
+>
cary 10432 0.0 2.6 1740 392 ? S Oct 9 0:00 axnet
cary 27883 0.9 31.0 12692 4596 ? S 10:24 0:04 axmain
- >
+>
Then run
-% strace -f -s 1024 -p 10432
- >
+>
+
$ strace -f -s 1024 -p 10432
+>
a Cannot launch gateway on server,
I ran strace on axnet and got
-<programlisting>
+<screen>
[pid 27947] open("/usr/lib/libodbc.so", O_RDONLY) = -1 ENOENT
(No such file or directory)
[pid 27947] open("/lib/libodbc.so", O_RDONLY) = -1 ENOENT
(No such file or directory)
[pid 27947] write(2, "/usr2/applix/axdata/elfodbc:
can't load library 'libodbc.so'\n", 61) = -1 EIO (I/O error)
-programlisting>
+screen>
So what is happening is that applix elfodbc is searching for libodbc.so, but it
cannot find it. That is why axnet.cnf needed to be changed.