Showing posts with label cant. Show all posts
Showing posts with label cant. Show all posts

Tuesday, March 27, 2012

connecting to SQL Server 2000 from a VB.net app using ADO.net

Hi
I can connect from my app to sql server on the local lan, but I can't connect over the
Internet. I can't create a remote connection in Enterprise Manager. However, I can
ping the IP address of the server just fine.
The app uses the following connect string:
Provider=SQLOLEDB;User
ID=******;Password=******;Server=******;Database=* *****;Network Address=******
Where 'Network Address' = the IP address of the machine where SQL Server is
installed.
This connect string works great from any machine connected to the same lan as the
SQL Server machine. However, whenever I try to connect across the Internet (from my
home machine, using the exact same software and connect string), I take the
following error:
Client unable to establish connection ConnectionOpen(CreateFile()
Question 1: Does anybody have any suggestions as to why I can connect over the LAN
but not over the Internet? I suspect some networking thing, like a firewall on the
lan where I am trying to connect, but I am not a networking expert.
Question 2: Does anyone have any opinion about whether this is a valid DBIO
technique? Most databases that are accessed over the Internet have thin-client
interfaces implemented in front of them. I have never tried to do this from a Windows
fat-client, and I suspect very poor performance and excess resource utilization on
the server
Any help or article will be appriciated
In terms of connectivity issues over the Internet, firewall
issues would be my first guess. You may want to take a look
at the following article:
INF: TCP Ports Needed for Communication to SQL Server
Through a Firewall
http://support.microsoft.com/?id=287932
In terms of the application issues, it depends on the app.
The resource problems on the database server are most often
due to coding issues, not really what type of client is
used. Either can perform well or perform poorly depending on
how they are coded.
-Sue
On Thu, 15 Apr 2004 09:56:07 -0700, "Lisa Jones"
<anonymous@.discussions.microsoft.com> wrote:

>Hi
>I can connect from my app to sql server on the local lan, but I can't connect over the
>Internet. I can't create a remote connection in Enterprise Manager. However, I can
>ping the IP address of the server just fine.
>The app uses the following connect string:
>Provider=SQLOLEDB;User
>ID=******;Password=******;Server=******;Database= ******;Network Address=******
>Where 'Network Address' = the IP address of the machine where SQL Server is
>installed.
>This connect string works great from any machine connected to the same lan as the
>SQL Server machine. However, whenever I try to connect across the Internet (from my
>home machine, using the exact same software and connect string), I take the
>following error:
>Client unable to establish connection ConnectionOpen(CreateFile()
>Question 1: Does anybody have any suggestions as to why I can connect over the LAN
>but not over the Internet? I suspect some networking thing, like a firewall on the
>lan where I am trying to connect, but I am not a networking expert.
>Question 2: Does anyone have any opinion about whether this is a valid DBIO
>technique? Most databases that are accessed over the Internet have thin-client
>interfaces implemented in front of them. I have never tried to do this from a Windows
>fat-client, and I suspect very poor performance and excess resource utilization on
>the server
>Any help or article will be appriciated
sqlsql

Thursday, March 22, 2012

Connecting to Remote SQL server - time out expired?

Hello

Im connecting to a remote SQL Server in Enterprise Manager Via VPN,

we checked the connection and everything but still o cant connect

to the remote server, Error message says "Time Out Expired",

we checked the firewall config, ADSL connection and it's all Ok

what seems to be the problem here??Hello

Im connecting to a remote SQL Server in Enterprise Manager Via VPN,

we checked the connection and everything but still o cant connect

to the remote server, Error message says "Time Out Expired",

we checked the firewall config, ADSL connection and it's all Ok

what seems to be the problem here??

There are oh so many possibilities...

1. Can you telnet to the remote server on the correct port?
2. Is there another firewall at the other end (I assume so since it's a VPN)? If so, can you verify that the traffic is getting beyond that firewall?
3. Are both firewalls set to handle the "hand-off" that occurs when incoming traffic on port 1433 is handed off to a negotiated port? This is usually automatic, but on some older firewalls, it must be manually configured.
4. Are you using hostname or IP address to connect? If hostname, what is the name resolution service running (I assume DNS)? If DNS, are you sure about the IP Address resolution?
5. Are you NAT'ing the internal IP addresses? Are the NATs configured correctly.

Look at your firewall logs carefully (hopefully there's a nice GUI to help you). The answer is likely in there somewhere. It may not be easy to find, but it's in there.

Regards,

hmscott

Monday, March 19, 2012

connecting to MSDE

I installed MSDE 200 on my machine running XP home
edition.
I cant connect to the db using the SQL mode, but i can
connect using the in windows modes. It returns and odbc
error stae 28000 , i dont know how to correct this.
If set up and odbc connection and try to test this, it
returns the following errore
Attempting connection
[Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'sa'. Reason: Not associated with a
trusted SQL Server connection.It looks like your MSDE instance is configured for Windows
Authentication only. The following article explains how to
change the authentication mode for MSDE during installation
as well as after installation:
INF: How to Change the Default Login Authentication Mode to
SQL While Installing SQL Server 2000 Desktop Engine by Using
Windows Installer
http://support.microsoft.com/?id=285097
-Sue
On Wed, 25 Feb 2004 19:31:09 -0800, "Lanre"
<lanre_makinde@.yahoo.com_remove.this> wrote:

>I installed MSDE 200 on my machine running XP home
>edition.
>I cant connect to the db using the SQL mode, but i can
>connect using the in windows modes. It returns and odbc
>error stae 28000 , i dont know how to correct this.
>If set up and odbc connection and try to test this, it
>returns the following errore
>Attempting connection
>[Microsoft][ODBC SQL Server Driver][SQL Server]Login
>failed for user 'sa'. Reason: Not associated with a
>trusted SQL Server connection.

Sunday, March 11, 2012

Connecting to DB2 Database - Drivers Needed

I am trying to connect my reporting services server to a DB2 server - What
drivers / info do i need to accomplish this. I cant seem to figure out how
to get this to work. Any help would be appreciated.You need an ODBC driver or an OLEDB driver. Either will work theorectically.
I go against Sybase and for them I found that the ODBC driver worked better.
Just a few days ago there was someone going against an AS400 running DB2
that has had good luck with ODBC.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"PCL" <PCL@.discussions.microsoft.com> wrote in message
news:16E09229-DEDF-4D37-9F9A-5D4897359C54@.microsoft.com...
> I am trying to connect my reporting services server to a DB2 server - What
> drivers / info do i need to accomplish this. I cant seem to figure out
how
> to get this to work. Any help would be appreciated.|||Thank You for your response - I guess i am not sure where i make this ODBC
connection. In .Net when i am creating a report it asks for a datasource
which I can use a DSN for. When i goto make a DSN, i do not see a generic
ODBC connection - I see ODBC for oracle but that is about it. How do i go
about creating this DSN?
Thanx!
"Bruce L-C [MVP]" wrote:
> You need an ODBC driver or an OLEDB driver. Either will work theorectically.
> I go against Sybase and for them I found that the ODBC driver worked better.
> Just a few days ago there was someone going against an AS400 running DB2
> that has had good luck with ODBC.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "PCL" <PCL@.discussions.microsoft.com> wrote in message
> news:16E09229-DEDF-4D37-9F9A-5D4897359C54@.microsoft.com...
> > I am trying to connect my reporting services server to a DB2 server - What
> > drivers / info do i need to accomplish this. I cant seem to figure out
> how
> > to get this to work. Any help would be appreciated.
>
>|||Assuming you have an ODBC driver installed, create a machine datasource
name. Then in RS create a new datasource, select the microsoft oledb for
odbc driver, you will then come to the screen that will allow you to pick
the DSN.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"PCL" <PCL@.discussions.microsoft.com> wrote in message
news:C27653D2-CBA2-43BD-A9AF-2A31DF5488FA@.microsoft.com...
> Thank You for your response - I guess i am not sure where i make this ODBC
> connection. In .Net when i am creating a report it asks for a datasource
> which I can use a DSN for. When i goto make a DSN, i do not see a generic
> ODBC connection - I see ODBC for oracle but that is about it. How do i go
> about creating this DSN?
> Thanx!
> "Bruce L-C [MVP]" wrote:
> > You need an ODBC driver or an OLEDB driver. Either will work
theorectically.
> > I go against Sybase and for them I found that the ODBC driver worked
better.
> > Just a few days ago there was someone going against an AS400 running DB2
> > that has had good luck with ODBC.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "PCL" <PCL@.discussions.microsoft.com> wrote in message
> > news:16E09229-DEDF-4D37-9F9A-5D4897359C54@.microsoft.com...
> > > I am trying to connect my reporting services server to a DB2 server -
What
> > > drivers / info do i need to accomplish this. I cant seem to figure
out
> > how
> > > to get this to work. Any help would be appreciated.
> >
> >
> >|||On Fri, 4 Mar 2005 08:59:03 -0800, PCL <PCL@.discussions.microsoft.com>
wrote:
>I am trying to connect my reporting services server to a DB2 server - What
>drivers / info do i need to accomplish this. I cant seem to figure out how
>to get this to work. Any help would be appreciated.
You maybe out of luck. OLE DB Provider for DB2 is not something you
can obtain free or even separately for a fee. As far as I know, it
only comes with MS Host Integration Server 2000 and 2004 (~$2500). We
recently had a discussion with Microsoft about this, and they
confirmed that this is a known business problem.
If you end up buying Host Integration Server, I'd strongly suggest you
get the latest release (2004): the provider seems to be less bugged
(it had some annoying instability issues in 2000), plus they now
include a managed provider as well, which is nice to have, if you're
programming on .NET platform.
There are other options, like getting a provider from IBM (or even
some 3rd party), but those are not free either, and I cannot tell you
much about them...

Wednesday, March 7, 2012

Connecting to a MSDE insance from DbVisualizer 4.1.1

Hi,
I need some help. I can't connect to my MSDE instance with DbVisualizer
v4.1.1. I know the DB is running because I am able to connect to it
with Teratrax v3.0 and also with osql.
Here's what I have done so far:
Start DbVisualizer
In the Driver Manager window, I let it find all the Drivers for SQL
Server (there isn't any for MSDE) and picked one that it found
(sun.jdbc.odbc.JdbcOdbcDriver)
Now the SQL Server has a green arrow next to it
I close the Driver Manager window
Try to create a DB Connection with that driver I get an error that
the "Lookup Name" is empty. What is it supposed to have?
Really appreciate all your help.
TIA.
- manzoor
I "think" the "Lookup Name" maybe something like Oracle tnsnames.ora
file. If it is, where would I find the equivalent file for MSDE and
what would it be called?
- manzoor

Friday, February 24, 2012

Connecting MS, or EM to a server on a non-trusted domain

We have just put a new SQL Server 2000 (on Windows Server 2003 R2) in a
non-trusted Windows domain.
I can rdp to the machine just fine, but I can't get MS to connect.
My machine (and most servers) are in the HOME domain and the new server is
in the non-trusted QA domain.
I've tried several combinations, including creating a SQL Server login for
my use on the server - no joy.
I'm fairly certain this can work, but I'm out of idea's as to how ...
Thanks,
Jay
Make sure that you configured the SQL in Mixed mode authentication.
Regards,
Mohammad Daoud | Technical Development Manager | Mobile +962 79 999 65 85
Tel. +962 6 554 3721 | daoudm@.greatpbs.com
http://www.greatpbs.com| http://www.facebook.com/group.php?gid=18895609248/
"Jay" wrote:

> We have just put a new SQL Server 2000 (on Windows Server 2003 R2) in a
> non-trusted Windows domain.
> I can rdp to the machine just fine, but I can't get MS to connect.
> My machine (and most servers) are in the HOME domain and the new server is
> in the non-trusted QA domain.
> I've tried several combinations, including creating a SQL Server login for
> my use on the server - no joy.
> I'm fairly certain this can work, but I'm out of idea's as to how ...
> Thanks,
> Jay
>
>
|||Ya, thanks. I had already checked that. Actually, I found that port 1433 was
blocked and that it was by design.
Jay
"Mohammad Daoud" <MohammadDaoud@.discussions.microsoft.com> wrote in message
news:CC64BC8A-BE8C-4BBC-BB84-AC45FA5BFBB7@.microsoft.com...[vbcol=seagreen]
> Make sure that you configured the SQL in Mixed mode authentication.
> Regards,
> Mohammad Daoud | Technical Development Manager | Mobile +962 79 999 65 85
> Tel. +962 6 554 3721 | daoudm@.greatpbs.com
> http://www.greatpbs.com|
> http://www.facebook.com/group.php?gid=18895609248/
> "Jay" wrote:

Sunday, February 19, 2012

Connecting JDBC with SQL Server, error establishing socket

I have tried everything..I cant get Java to connect to my sql
server...
heres the code I altered provided my microsoft to test this connection:
import java.sql.*;
class test {
public static void main(String args[]) {
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLSer verDriver").newInstance();
Connection conn = DriverManager.getConnection(
"jdbc:datadirect:sqlserver://dbserver:1433;DatabaseName=sample",
"sa", "");
conn.close();
System.out.println("ok");
}
catch (Exception e) {
e.printStackTrace();
}
}
}
Heres the error messages:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error
establis
hing socket.
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown
Source
)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<in it>(Unknown
Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnecti on.open(Unknown
Sou
rce)
at
com.microsoft.jdbc.base.BaseConnection.getNewImplC onnection(Unknown S
ource)
at com.microsoft.jdbc.base.BaseConnection.open(Unknow n Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager .java:512)
at java.sql.DriverManager.getConnection(DriverManager .java:171)
at test.main(test.java:12)
thanks
It appears that you do not have access to your db server machine.
try ping command for the IP address.
This has to do with the network settings.
I use MSSQLServer driver and It seems that my DB-URL is different.
DRIVER=com.microsoft.jdbc.sqlserver.SQLServerDrive r
URL=jdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor
this works fine.
Message posted via http://www.sqlmonster.com

Connecting JDBC with SQL Server

I have tried everything..I cant get Java to connect to my sql
server...port 1433 is what sql server is running off of..my password
and username are correct..ive tried the ip, comp name and localhost for
server name and I cant make a connection to it...
heres the code I altered provided my microsoft to test this connection:
public class Connect{
private java.sql.Connection con = null;
private final String url = "jdbc:microsoft:sqlserver://";
private final String serverName= "192.168.1.102";
private final String portNumber = "1433";
private final String databaseName= "KB";
private final String userName = "kbuser";
private final String password = "password";
// Informs the driver to use server a side-cursor,
// which permits more than one active statement
// on a connection.
private final String selectMethod = "cursor";
// Constructor
public Connect(){}
private String getConnectionUrl(){
return
url+serverName+":"+portNumber+";databaseName="+dat abaseName+";selectMethod="+selectMethod+";";
}
private java.sql.Connection getConnection(){
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLSer verDriver");
con =
java.sql.DriverManager.getConnection(getConnection Url(),userName,password);
if(con!=null) System.out.println("Connection
Successful!");
}catch(Exception e){
e.printStackTrace();
System.out.println("Error Trace in getConnection() : " +
e.getMessage());
}
return con;
}
/*
Display the driver properties, database details
*/
public void displayDbProperties(){
java.sql.DatabaseMetaData dm = null;
java.sql.ResultSet rs = null;
try{
con= this.getConnection();
if(con!=null){
dm = con.getMetaData();
System.out.println("Driver Information");
System.out.println("\tDriver Name: "+
dm.getDriverName());
System.out.println("\tDriver Version: "+
dm.getDriverVersion ());
System.out.println("\nDatabase Information ");
System.out.println("\tDatabase Name: "+
dm.getDatabaseProductName());
System.out.println("\tDatabase Version: "+
dm.getDatabaseProductVersion());
System.out.println("Avalilable Catalogs ");
rs = dm.getCatalogs();
while(rs.next()){
System.out.println("\tcatalog: "+
rs.getString(1));
}
rs.close();
rs = null;
closeConnection();
}else System.out.println("Error: No active Connection");
}catch(Exception e){
e.printStackTrace();
}
dm=null;
}
private void closeConnection(){
try{
if(con!=null)
con.close();
con=null;
}catch(Exception e){
e.printStackTrace();
}
}
public static void main(String[] args) throws Exception
{
Connect myDbTest = new Connect();
myDbTest.displayDbProperties();
}
}
Heres the error messages:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error
establishing socket.Error Trace in getConnection() :
[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
Error: No active Connection
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<in it>(Unknown
Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnecti on.open(Unknown
Source)
at com.microsoft.jdbc.base.BaseConnection.getNewImplC onnection(Unknown
Source)
at com.microsoft.jdbc.base.BaseConnection.open(Unknow n Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager .java:512)
at java.sql.DriverManager.getConnection(DriverManager .java:171)
at Connect.getConnection(Connect.java:36)
at Connect.displayDbProperties(Connect.java:53)
at Connect.main(Connect.java:89)
thanks
-Jim
Jim,
There could be a number of reasons why a connection can't be
established: server not running, TCP/IP not enabled on the server, a
firewall blocking the connection etc. Check all these and until "telnet
<server_host> 1433" won't connect, the JDBC driver won't connect either
(unless it used named pipes).
Alin,
The jTDS Project.
|||Yep...I could not telnet to that port and when I did a netstat sql
server wasnt listening on that port...
To fix this I upgraded from the RTM to service pack3...rebooted and was
able to connect just fine...
Thanks
-Jim