Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ODBC Connection Issue

Posted on 2013-11-20
14
Medium Priority
?
901 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 5
14 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 1500 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 84

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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 

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 84

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 84

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
 

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 84

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

670 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