Connecting to same-named servers & databases on different machines -
04-15-2005
, 07:52 AM
Hi all,
I've been hopelessly trying to connect multiple Gupta SQLBase databases
via ODBC/OLEDB/.NET data providers, all with no luck.
I've been developing an application for a customer and this
application involves transferring the data into an SQLServer database,
from customer's four different SQLBase servers located on different
sites, all connected through a WAN.
I've searched a lot and found that multiple 'serverpath' entries in
SQL.INI file are allowed. With only one entry, there is no
problem and I can connect to the specified server via ODBC, OLEDB
or .NET data provider. But when I add the information for other
servers to SQL.INI file, connection attempts fail with an error
message telling me that there are duplicate entries. It seems
that the driver requires that the servername, machinename and
databasename parts of the 'serverpath' entries should all be different.
But it doesn't make sense at all to me because
the developers of application software and people who install and
implement those applications always tend to use same names
for server instances, database names etc. and this is the case
for our customer's database installations. Shouldn't it be
enough if only the IP addresses are different ?
To solve this problem, I tried many different methods.
The documentation of .NET data provider which is developed by Gupta
tells that the name of the INI file which will be used for connection
can be specified in the connection string. This
feature would be a great one if it did worked as explained !..
I tried it in a loop in which each iteration makes a connection string
with a different ini filename, tries to open a connection,
selects some data from a table and then closes the connection.
First iteration works well, but in subsequent calls it always connects
the same server from the first one, not the one pointed
by the new ini file. When I change the order of servers and
re-run my test app, it connects to other servers as well,
but only to the first one again. I thought that client driver and
database versions that I've been using don't match and the driver may
not be looking for the ini file that specified by connection string.
So I decided to go to default route, not specifying an ini filename,
letting the driver use the default SQL.INI file.
This time, in each iteration, my test app copied a different ini file
(which was prepared previously and includes different settings for each
server) onto the default SQL.INI file. Unfortunately I ended up with
same result again, all connection attempts going to the first server in
the order that I tried.
I tried some other things on SQLServer such as linked servers, stored
procedures, DTS packages, none with any success.
It seems that there is something wrong (or works that way by design)
with the driver initialization or something like that.
It takes server/database names at the start and uses them
as long as that session lives.
I think connecting to same-named Gupta databases on different
machines are impossible or I've been doing something fundamentally
wrong !..
Why, oh why, can't I specify the machine/database name in the
connection string (as in SQLServer connections) or setting
aliases just as I like in configuration file (as in Oracle connections)
?
Any Gupta people hearing me ?
I'd appreciate any bit of help.
Thanks. |