access connect to informix
Posted in 2004
Topics: Installation, Setup & Upgrades, Connectivity: ODBC / JDBC / .NET, Security, Permissions & Auditing
Hi, i'm a newbie with informix databases. my current goal is linking informix database with Access through ODBC. I've gathered information on how to setup access and setnet32. But my problem is that i don't know where are the values i have to set in access or setnet32 to connect an informix DB. Here are the values i need to know : DBDATE = ??? DBPATH = what should be the syntax of the field? ($INFORMIX\\path\\to\\database?) informix_server = is it the name of the server? Its IP address? something else? host name = apparently the IP address could match protocol = which protocol is the good one? Does it depend of the informix version? If yes, how can i get the version of informix installed? service name = ??? Current host : i've seen it should be the same than informix server User name : which one? password : Thank you in advance for your help Thibault
Thibault:
Some months ago I had same problems you're having now: no suitable
information for specific Informix ODBC connection.
Although all info I can offer you is Informix-SE specific (the database
server I work with), hope that can help you anyway:
1) I assume your network (TCP/IP) and also your database server (I-SE) is
"up and running";
2) Database server is on a remote Unix server;
3) I-SE doesn't require additional software for networking access (e.g.
Informix-Connect) (I-SE v.5+?);
4) Informix SDK v.2.81 TC3 is installed on a Windows XP client machine;
First things first: Informix server side (Unix)
5) You must add a service (remember setnet32?)
A service may be seen as a network port. When you connect to a web page you
probably are using port 80 (http "service"). Every "service" must have a
different port (ftp and telnet are other examples). You must define a
service for database connection;
6) Find your services file (may be located in /etc);
7) Add a new service by adding one last line to file. Could be:
ifx_cli 1526/tcp
Note that ifx_cli will be your service name and should not already exist in
services file; 1526 should also be unique (could be any number but remember
to use a reasonable high value because lower values may be reserved, even if
not in use); tcp is about the tcp protocol (you don't need to define udp
lines);
8) Find your Informix sqlhosts file (should be located in $INFORMIXDIR/etc).
It's where you have to configure networking access to your database server;
9) In sqlhosts file, you may already have a line like this:
db_name seipcpip host_name sqlexec
db_name: name of the local database name (also known as database server or
Informix server);
seipcpip: This depends on your database server. se is for I-SE, ipc and
pip is about local connection-see your database server documentation;
host_name: name of the host where your database is located (ip address may
work(?))
sqlexec: informix process for local I-SE connection (known as "service")
10) Add an additional line:
db_server setlitcp host_name service_name
db_server: Name of the Informix server (remember setnet32?). Can be any name
(but not equal to any other db_name already existing on this file);
setlitcp: Again, this depends on your DBMS. se is for I-SE, tli and tcp is
for network connection (TCP/IP)-see your database server documentation;
host_name: name of the host where your database is located (ip address may
work(?))
service_name: Name of the service you had created in services file (do not
use sqlexec!);
11) An Informix daemon must be running (with appropriate rights):
<informixdir>/lib/sqlexecd db_server [-l <any_path>/SQLEXECD.LOG]
Notes:
a) You should execute this command as root (Administrator);
b) You may need to define INFORMIXDIR system variable before executing above
command:
INFORMIXDIR=/usr/inf7 (where your informix-se is installed)export INFORMIXDIR
c) db_server is the name of the informix server (see sqlhosts);
d) -l flag is optional. It produces a logfile;
e) You may want to execute this command every time you boot your server
machine. I added these lines to /etc/rc.d/8/userdef file);
You may need to restart your server.
Client side (Windows XP):
12) You must add same service used on server side (ifx_cli), to your
services file on this client machine:
Win98: c:\\windows\\services
WinXP: c:\\windows\\system32\\drivers\\etc\\services
13) You may have to reboot your machine;
14) Locate ODBC (DSN) icon
ODBC data sources on WinXP: Control Panel/Administrative tools/Data Sources
15) Create and configure a DSN connection
a) You may need Administrative rights
b) Add a User DSN or System DSN
c) Select IBM Informix 3.82 32 bit
d) Write any name you want for Data Source Name (e.g. ifx_cli), under
General tab
e) Connection tab
Server name: db_server - Your remote Informix server name (see sqlhosts)
Host Name: host_name - Remote machine where Informix server is (see
sqlhosts)
Server: ifx_cli (see sqlhosts)
Protocol: sesoctcp (se: I-SE; soc: Sockets; tcp: TCP/IP) - Database
specific. Note this is not the one used in sqlhosts.
Database name: The name of your database on your remote server (although it
can have the same name, this is not your database server name!)
User Id: A remote user (that is, on server) with local access to the
database. I suggest the user where the database is located. If not, you may
have to define DBPATH (on setnet32?)
Password: Password for Username. If remote user has no password (no security
issues), you may want to set one (I'd problems connecting to a user with no
password)
f) Click Apply and Test Connection
I'm not sure you have to configure setnet32. However, you may want to test
your connection using DBPing so you may find useful to configure setnet32:
16) setnet32 environment:
Except for INFORMIXDIR (that should be already set - e.g. C:\\Program
Files\\Informix\\Client-SDK\\ (it points to local informix directory), none of
the variables have to be set.
You may, however, set some of them for defining default values. I've set
INFORMIXSERVER (db_server) only (see sqlhosts, on server)
DBDATE is for default date output format
DBPATH is the path for your database (.)
17) setnet32 server information
IBM Informix Server: db_server (see sqlhosts file)
Host Name: host_name (see sqlhosts file)
Protocol Name: sesoctcp (se: I-SE; soc: Sockets; tcp: TCP/IP) - Database
specific. Note this is not the one used in sqlhosts.
Service Name: ifx_cli (see sqlhosts)
Options: Database specific - not required for I-SE
You may want to make that your default server (for default server values)
18) setnet32 Host Information
Current Host: host_name (see sqlhosts)
Username: A remote user (that is, on server) with local access to the
database. I suggest the user where the database is located. If not, you may
have to define DBPATH (on setnet32?)
Password: Password for Username. If remote user has no password (no security
issues), you may want to set one (I'd problems connecting to a user with no
password)
19) Test your connection with DBPing
Still need help for this fields? I hope not.
Please tell me if still have questions.
Hope this help,
JC