Unable to connect to SQL Server 2005

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
timothy.lau
New user
New user
Posts: 10
Joined: 2009-09-25 10:54

Unable to connect to SQL Server 2005

Post by timothy.lau » 2009-09-25 11:07

Hi guys,

I m now setting up the hMail server in a win2k8 server which is located in the DMZ of the company. There is another server which is located in the Internal network, which is exactly the same settings as the one in DMZ.

Now, the internal machine is capable to CREATE and CONNECT to the SQL server database. However, the server in DMZ is not working to CREATE nor CONNECT to any SQL server.

Here is the error message shown when I try to connect or create in the hMailserver Database Setup.

Starting task...
Please wait while updating database settings...
ADO: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.


The following is the LOG that I found from the hMailserver program path.
"ERROR" 5460 "2009-09-25 16:45:07.318" "Severity: 1 (Critical), Code: HM5028, Source: ADOConnection::Connect, Description: Error when connecting to database. Microsoft OLE DB Provider for SQL Server [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. Check your database settings in hMailServer.ini."

Indded, I tried to use the Data Source (ODBC) to try to connect to the SQL server. It looks fine. I also try to telnet sqlserver.net 1433 which also working fine.
It proves that the 1433 on the firewall between the DMZ and Internal networks are set.

But is there any suggestion that I can find out why I cant connect nor Create the DB?

Timothy Lau

Keba
Normal user
Normal user
Posts: 126
Joined: 2009-04-11 11:43

Re: Unable to connect to SQL Server 2005

Post by Keba » 2009-09-25 21:34

It sounds like you would want to talk to your firewall administrator and get them to check the logs to see if the connection is getting that far or not.

This could be a routing problem or a firewall rule problem... Or something else altogether!
Keba

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Unable to connect to SQL Server 2005

Post by martin » 2009-09-26 11:26

My guesses are:

- Firewall is not properly opened.
- SQL Server has not been configured to allow connections from other computers.
- The SQL Server installation has an instance name, so the actual name of the SQL Server is <computername>\<instancename> rather than just <computername>.

timothy.lau
New user
New user
Posts: 10
Joined: 2009-09-25 10:54

Re: Unable to connect to SQL Server 2005

Post by timothy.lau » 2009-09-26 12:53

Hi,

Its correct. I think over 90% that the firewall is not opened properly. However, I searched in this site, there is no such information (or not a general practice) about which TCP or UDP ports needed to be opened. Its a bit hard to discuss with the "firewall" guys if we are just having such "reasons".
So, is there any documentation about this? coz I couldn't search it out. That could help me a lot~ 8)

(Of coz, at last, if they dont open it, the application is not possible, then the whole thing will not be happened.)

***
Yes, the SQL is with the SERVERNAME\INSTANCE name. I tried both way, but not work.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Unable to connect to SQL Server 2005

Post by martin » 2009-09-26 13:21

Why are you looking for information on *this* site on how to configure SQL Server to allow connections from the outside? That's a SQL Server topic, not a hMailServer topic...

timothy.lau
New user
New user
Posts: 10
Joined: 2009-09-25 10:54

Re: Unable to connect to SQL Server 2005

Post by timothy.lau » 2009-09-26 13:31

Indeed I m juz looking for why i juz opened the firewall ports with 1433 from external to internal, and that looks like the ports opened are not enough. I wonder why when I use hMailserver to connect / create the DB thru the firewall, it looks not just for 1433 port. Thanks

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Unable to connect to SQL Server 2005

Post by martin » 2009-09-26 13:43

> Indeed I m juz looking for why i juz opened the firewall ports with 1433 from external to internal

Sorry, what does "juz" mean? Just?

You need to set up surface area configuration for SQL Server. Have you done this?

timothy.lau
New user
New user
Posts: 10
Joined: 2009-09-25 10:54

Re: Unable to connect to SQL Server 2005

Post by timothy.lau » 2009-09-26 14:14

Juz = just :oops:

Sorry may I know what is the meaning of surface area configuration for SQL server?

Thanks

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Unable to connect to SQL Server 2005

Post by martin » 2009-09-26 14:17

SQL Server does by default not allow incoming connections from other computers, regardless of the firewall settings. You need to enable this manually, which I believe is typically done using something called SQL Server Surface Configuration tool. You also need to enable TCP/IP if you want to allow connections from other computers.

My point is that this is SQL Server configuration-related. If you don't know how to do these things, talk to the SQL Server DBA or read the SQL Server documentation... :)

timothy.lau
New user
New user
Posts: 10
Joined: 2009-09-25 10:54

Re: Unable to connect to SQL Server 2005

Post by timothy.lau » 2009-09-30 11:51

finally talk to the "firewall" guys, they opened the ports of 139/445, then the creation and connection from DMZ back to internal is successful.

Thanks
Tim

Post Reply