Solved

ODBC Connection Issue

Posted on 2013-11-20
14
767 Views
Last Modified: 2014-01-06
HEllo Experts,

I have an ODBC Connection set up from a client to a DB Server on the same network and it works fine.

It works fine until I change the subnet of the network that is...

E.g.

1. If I have the client and Server set up on this network:

IP: 192.168.0.x
SM:255.255.255.0
DG:192.168.0.1

DNS:192.068.0.1

My ODBS Connects just fine but if I change to this network:

IP: 192.168.4.x
SM:255.255.255.0
DG:192.168.4.1

DNS:192.068.4.1


The ODBS Connection fails with this error:

SQLSTATE = 08001
[Sybase][ODBC Driver][SQLAnywhere]Database not found

**I can ping, remote into and browse files to each computer from the other so I know there is communication.

The weird thing is if I switch back to the first subnet (198.168.0.x), the ODBC works fine again! The only Difference is that the 192.168.4.x subnet is on the LAN side of a SOPHOS firewall (oth clients are on the LAN side of the firewall)

Does anyone know what is going on here?

Thanks!
0
Comment
Question by:Saxitalis
  • 9
  • 5
14 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39664311
Besides what the firewall may restrict, you are normally limited to IPs on the same network segment as defined by the SM (Segment Mask).  And you can't just change that on one computer.  For things to work right, you would have to change it on all computers or in DHCP if you are using that.  As you can see, ping is not limited that restriction.
0
 

Author Comment

by:Saxitalis
ID: 39667353
I have confirmed that the firewall is not the issue since both server and client are on the same network segment (same default gateway.

What is the difference between TCP/IP and shared memory on the network tab?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39667424
"TCP/IP and shared memory" are two different methods of communicating.  I would use TCP/IP although I believe that may require you to use SQL Authentication.

The "same default gateway" does not determine the network segment.  The mask does.  As you show it above, 192.168.0.x and 192.168.4.x are not on the same segment.  You would have to use 255.255.248.0 to be on the same segment.  The mask limits what you can connect to.  And it needs to be the same for all machines on the network.  http://jodies.de/ipcalc
0
 

Author Comment

by:Saxitalis
ID: 39667523
sorry typo on small screen :)

OP: 192.168.4.x
NM: 255.255.255
DG: 192.168.4.1

...on both client and server (actually defined statically)
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39667736
Ok, that's kind of confusing.  Only thing I can think of is that the connection defined in ODBC isn't getting changed when you change the network.
0
 

Author Comment

by:Saxitalis
ID: 39667828
How would you need to change the ODBC connection when changing networks?

Doesn't ODBC "discover" the server on the network regardless of what the network's addressing is like as long as the client doing the asking and the server providing the database are on the same network?

What are the basics of an ODBC connection (maybe I am missing something here)?

1. Choose appropriate drive
2. Define the server
3. enter authentication info
4. ??
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39668060
Doesn't ODBC "discover" the server
Not on any of my systems.  You have to select the server.  If the server is defined by the IP address as is often the case, then clearly it won't be found when you change the network.

See if 're-selecting' the server in the ODBC setup causes the connection to work.  If it does, that means the IP address is being saved in the ODBC connection info.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:Saxitalis
ID: 39668081
This database is SQl Anywhere (I have never used it before) I have set up SQL Server 2005 quite a bit and all you have to do is type in the Server/Instance name along with valid DB user/pswrd to connect.

Ya, I have tried re-entering the server several times to no avail...

You say the ODBC connection may be saving the I address somewhere. Do you have any idea where to look to see if that is the case??
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39668107
The Sybase SQl Anywhere documentation is very confusing.  There is only one mention of ODBC that I found and no information to go with it.  However, in several places I see that you are supposed to tell the server what it's IP address is.  Maybe that's where the problem is.
0
 

Author Comment

by:Saxitalis
ID: 39671519
Actually I found a good article: http://www.sybase.com/detail?id=47961

It says to define the IP if you are using TCP/IP rather than shared memory on the network tab (ODBC properties)

I ran a test:

Network 1 (The one that works)
Network 2 (The one that does not work)

Network 1:
I set static IP's on SQL Anywhere server and client then defined TCPIP (and pointed to the server's IP address) on ODBC network tab.

This works fine!

Now I did same for Network 2 and the connection fails with "cannot find server message"

1. I can ping back and forth between server and client, transfer files etc.
2. I really don't think the firewall is the issue because no traffic is going through the firewall

External address to firewall: 192.168.0.1
Internal network on firewall: 192.168.4.0/24
SQL Anywhere server IP: 192.168.4.12
Client accessing SQL Anywhere server: 192.168.4.10

So...

The only real difference between Network 1 and Network 2 are different subnets

Can anyone think of another test to help figure out what is going on here?
0
 

Author Comment

by:Saxitalis
ID: 39671571
Another thought...

Do you need to define the Port ( I think it may be 2638) on the ODBC network tab since both client and server are on the same subnet inside the firewall?
0
 

Author Comment

by:Saxitalis
ID: 39699050
1. I powered down/up the only network switch (in between client and server) to clear the ARP cache and tried the ODBC again - still no love.

2. I tried to open port 2638 using telnet from the server and the client (where the ODBC connection that is not working lives)

E'g' telnet 192.168.4.11 2638
Works fine if running on server
will not open if running on client.

It seems like...

Since telnet will not even open server port 2638 from the client, that the ODBC connection cannot work??

Does anyone have any ideas what may e happening here?

Thanks!
0
 

Author Comment

by:Saxitalis
ID: 39704334
The real problem here is this: Cannot create ODBC connection over the network (client to server) but same ODBC connection works fine locally on server.

I have simplified things by taking out the Sophos firewall

1. I took the hardware firewall out of the network
2. I set the client and server up in my office (Clearwire Internet NATs to 192.168.1.x)

SQL Anywhere server TCP/IP: Win7 32bit

IP:   192.168.1.201
SM:  255.255.255.0
DG:  192.168.1.1
DNS: 192.168.1.1

Client trying to access TCP/IP: Win 7 64 bit

IP:   192.168.1.200
SM:  255.255.255.0
DG:  192.168.1.1
DNS: 192.168.1.1

3. Windows firewall is turned off on both computers
4. I cannot telnet into the server SQL Anywhere port from the client like this:

telnet 192.168.1.201 2638

note (I CAN telnet into the server when telnet string shown above is called FROM the server computer)

5. ODBC to the SQL Anywhere DB works from the server computer but WILL NOT work  from the client computer to server computer. Note. I am using the 32 bit ODBC on the client since the server is a 32 bit installation.

Can anyone see what may be going on here?
0
 

Author Closing Comment

by:Saxitalis
ID: 39760560
It was Windows Firewall and explicit exception for one IP address
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now