Tuesday, March 27, 2012
connecting to SQL Server 2000 using JDBC
import java.sql.*;
/**
* Microsoft SQL Server JDBC test program
*/
public class test1 {
public test1() throws Exception {
// Get connection
DriverManager.registerDriver(new
com.microsoft.jdbc.sqlserver.SQLServerDriver());
Connection connection = DriverManager.getConnection(
"jdbc:microsoft:sqlserver:@.255.255.255","abc","abc");
if (connection != null) {
System.out.println();
System.out.println("Successfully connected");
System.out.println();
// Meta data
DatabaseMetaData meta = connection.getMetaData();
System.out.println("\nDriver Information");
System.out.println("Driver Name: "
+ meta.getDriverName());
System.out.println("Driver Version: "
+ meta.getDriverVersion());
System.out.println("\nDatabase Information ");
System.out.println("Database Name: "
+ meta.getDatabaseProductName());
System.out.println("Database Version: "+
meta.getDatabaseProductVersion());
}
} // Test
public static void main (String args[]) throws Exception {
test1 test = new test1();
}
}
I'm able to compile but when I run the program, the given error is:
Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unable to connect. Invalid URL.
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.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager .java:512)
at java.sql.DriverManager.getConnection(DriverManager .java:171)
at test1.<init>(test1.java:10)
at test1.main(test1.java:31)
I have checked that the given IP address is correct, so please can anyone enlighten me about the problem.
Thanks.You must set your database name and port number such as following
Connection connection = DriverManager.getConnection(
"jdbc:microsoft:sqlserver:@.255.255.255:1433;Databas eName=MyDB","abc","abc");
You can also use your computer name in url
"jdbc:microsoft:sqlserver://MYSERVER:1433;DatabaseName=MYDB","USERID","PASSWORD"
Originally posted by diablos00
I've download Microsoft SQL Server 2000 JDBC Driver. All these files are being installed and saved in a folder called sql. For example, the IP adress is 255.255.255.255 , I updated the code and saved it as test1.java in this manner:
import java.sql.*;
/**
* Microsoft SQL Server JDBC test program
*/
public class test1 {
public test1() throws Exception {
// Get connection
DriverManager.registerDriver(new
com.microsoft.jdbc.sqlserver.SQLServerDriver());
Connection connection = DriverManager.getConnection(
"jdbc:microsoft:sqlserver:@.255.255.255","abc","abc");
if (connection != null) {
System.out.println();
System.out.println("Successfully connected");
System.out.println();
// Meta data
DatabaseMetaData meta = connection.getMetaData();
System.out.println("\nDriver Information");
System.out.println("Driver Name: "
+ meta.getDriverName());
System.out.println("Driver Version: "
+ meta.getDriverVersion());
System.out.println("\nDatabase Information ");
System.out.println("Database Name: "
+ meta.getDatabaseProductName());
System.out.println("Database Version: "+
meta.getDatabaseProductVersion());
}
} // Test
public static void main (String args[]) throws Exception {
test1 test = new test1();
}
}
I'm able to compile but when I run the program, the given error is:
Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unable to connect. Invalid URL.
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.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager .java:512)
at java.sql.DriverManager.getConnection(DriverManager .java:171)
at test1.<init>(test1.java:10)
at test1.main(test1.java:31)
I have checked that the given IP address is correct, so please can anyone enlighten me about the problem.
Thanks.|||I had the same problem,
The problem is that the Microsoft jdbc driver used unicode and Ianywhere can't handle it.
Use an other jdbc driver from a 3de party will solve this problem.
I used the jdbc driver from datadirect (Type 4 jdbc driver) and this one
was working perfectly. Only thing is you have to pay for it.
I hope i could help you with this.
Greetz|||Microsofts JDBC driver works just fine. In fact it's an old data direct Type 4 driver. Make sure you have the service pack 1 jdbc driver. Here's the exact connection url I use with no problems.
jdbc:jtds:sqlserver://tlmssql3:1388/db1;USER=appsrv1;PASSWORD=password;TDS=8.0
Sunday, March 11, 2012
Connecting to DB2 / AS 400 from SQL Server
I wish to access a DB2 database wich is on a AS 400.
1) wich OLE db driver must we use ?
2) where can we download it ?
3) is it free ?
3) how to configure it ?
We have try different syntaxes without success :
Example :
sp_addlinkedserver @.server = 'AccesDB2_AS400_TRY1'
, @.srvproduct = 'Microsoft OLE DB Provider for DB2'
, @.provider = 'DB2OLEDB'
, @.location = 'ASILON'
, @.provstr = 'Initial Catalog=EPSILON;Data
Source=DB2;HostCCSID=1252;Network Address=192.168.1.15;Network
Port=50000;Package Collection=admin;Default Schema=admin;'
, @.catalog = 'EPSILON'
Our AS 400 server name is ASILON
Our AS 400 server adress IP is 192.168.1.15
The database name is EPSILON
What are we missing ?
thanks
Frdric BROUARD, MVP SQL Server, expert bases de donnes et langage SQL
Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
Audit, conseil, expertise, formation, modlisation, tuning, optimisation
********************* http://www.datasapiens.com ***********************Hi Frdric,
There should be an OLEDB DB2 provider distributed with MDAC. From here you
can download the latest version:
http://msdn.microsoft.com/data/mdac...ds/default.aspx
Here are a couple of good links providing information about formatting
connection strings:
http://www.carlprothman.net/Default.aspx?tabid=81
http://www.connectionstrings.com/
JT
"SQLpro [MVP]" <brouardf@.club-internet.fr> wrote in message
news:%238ucAMsRGHA.2300@.TK2MSFTNGP11.phx.gbl...
> Bonjour,
> I wish to access a DB2 database wich is on a AS 400.
> 1) wich OLE db driver must we use ?
> 2) where can we download it ?
> 3) is it free ?
> 3) how to configure it ?
> We have try different syntaxes without success :
> Example :
> sp_addlinkedserver @.server = 'AccesDB2_AS400_TRY1'
> , @.srvproduct = 'Microsoft OLE DB Provider for DB2'
> , @.provider = 'DB2OLEDB'
> , @.location = 'ASILON'
> , @.provstr = 'Initial Catalog=EPSILON;Data
> Source=DB2;HostCCSID=1252;Network Address=192.168.1.15;Network
> Port=50000;Package Collection=admin;Default Schema=admin;'
> , @.catalog = 'EPSILON'
>
> Our AS 400 server name is ASILON
> Our AS 400 server adress IP is 192.168.1.15
> The database name is EPSILON
> What are we missing ?
>
> thanks
> --
> Frdric BROUARD, MVP SQL Server, expert bases de donnes et langage SQL
> Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
> Audit, conseil, expertise, formation, modlisation, tuning, optimisation
> ********************* http://www.datasapiens.com ***********************|||this posting made my day!!!
thanks!!!
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"JT" wrote:
> Hi Frédéric,
> There should be an OLEDB DB2 provider distributed with MDAC. From here you
> can download the latest version:
> http://msdn.microsoft.com/data/mdac...ds/default.aspx
> Here are a couple of good links providing information about formatting
> connection strings:
> http://www.carlprothman.net/Default.aspx?tabid=81
> http://www.connectionstrings.com/
> JT
> "SQLpro [MVP]" <brouardf@.club-internet.fr> wrote in message
> news:%238ucAMsRGHA.2300@.TK2MSFTNGP11.phx.gbl...
>
>
connecting to database
I was trying to connect to datatbase on my computer, through java. I understand that I will need to download JDBC driver for that. But i am not sure which driver will I need, and where do i need to put it. Do I have to make some changes in CLASSPATH as well?
I am using SQL 2000. My jdk profile is j2sdk1.4.2.01. Also what is subname in
jdbc:<subprotocol>:<subname>
is it the name of database or what?
In need of help !!!!!!
thanks in advanceThe jdbc drive should be in the classpath and added to your project (depends on your environment).
I believe that the subname is the database (could be its ip), with subprotocol being the driver, for db2 its db2, not sure thought for sql 2000.
Are you creating a standalone java application and appled or jsp ?
Saturday, February 25, 2012
Connecting SQL Server Management Studio to an ODBC DSN
I'm not even sure if this is possible ... but here is my scenario:
We use a proprietary database. The database vendor wrote an ODBC driver which works well. So I have code that can connect to the database, do queries, etc. Can I use SQL Server Management Studio to connect to an ODBC DSN?
Ideally I would like to use the Object Browser and "Query Analyzer" (or whatever it's called) against the tables in this database.
Any help would be greatly appreciated.
Thanks.
-Aaron
No, SSMS only works against SQL Server 2000 and 2005.
The Tools forum is probably more appropriate for this question.
|||Moving the thread...CONNECTING SQL 2005 TO SYSTEM DNS ODBC?
Hi
I have a server with SQL 2005 and I have second server with spesial database program on it from IBM and I have installed a spesial ODBC DRIVER from IBM so I can make a connection in system dns.
On my server 1 where I have the sql 2005 I have made a connection in system dns.
HOW CAN I TELL SQL 2005 TO CONNECT TO MY CONNECTION AND GET DATA FROM DER?
It's DSN rather than DNS.
Please check this page for connection string using DSN: http://www.connectionstrings.com/?carrier=dsn
Friday, February 24, 2012
CONNECTING SQL 2005 TO SYSTEM DNS ODBC?
Hi
I have a server with SQL 2005 and I have second server with spesial database program on it from IBM and I have installed a spesial ODBC DRIVER from IBM so I can make a connection in system dns.
On my server 1 where I have the sql 2005 I have made a connection in system dns.
HOW CAN I TELL SQL 2005 TO CONNECT TO MY CONNECTION AND GET DATA FROM DER?
It's DSN rather than DNS.
Please check this page for connection string using DSN: http://www.connectionstrings.com/?carrier=dsn
Sunday, February 19, 2012
connecting jdbc type 4 with ms sql server.
I am using windows 2000 and i want to connect to ms sql server with
jdbc type 4 driver.
can you give me sample code and few tips to get me through this.,
thank you in advance,
vishnu.http://support.microsoft.com/defaul...kb;en-us;313100
http://java.sun.com/docs/books/tuto...ot0/sample.html
HTH,
Dave
"vishnu mahendra" <vishnu_mahendra@.yahoo.com> wrote in message
news:c24d8b9.0311200931.2e4d5ad2@.posting.google.co m...
> Hello to all,
> I am using windows 2000 and i want to connect to ms sql server with
> jdbc type 4 driver.
> can you give me sample code and few tips to get me through this.,
> thank you in advance,
> vishnu.|||"Dave Hau" <nospam_dave_nospam_123@.nospam_netscape_nospam.net_ nospam> wrote in message news:<puevb.11619$_m6.10136@.newssvr13.news.prodigy.com>...
> http://support.microsoft.com/defaul...kb;en-us;313100
> http://java.sun.com/docs/books/tuto...ot0/sample.html
> HTH,
> Dave
>
> "vishnu mahendra" <vishnu_mahendra@.yahoo.com> wrote in message
> news:c24d8b9.0311200931.2e4d5ad2@.posting.google.co m...
> > Hello to all,
> > I am using windows 2000 and i want to connect to ms sql server with
> > jdbc type 4 driver.
> > can you give me sample code and few tips to get me through this.,
> > thank you in advance,
> > vishnu.
hello dave,
Thank you for the information.
your help is much appreciated.
vishnu.
Connecting jdbc driver from an applet
Hi,
I've found problems when executing
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
I get a java.lang.ClassNotFoundException, and I have done this steps:
1o I got the driver from msdn web page
2o I modified the classpath in Windows XP adding the path to the sqljdbc.jar, testing if there was any problems with blanks in the path, I tried to put the .jar file in a more simple folder, but it didn't work.
Perhaps I've to do something whith my policy.java or so archives to let applets do something about this but I have no idea.
Can someone help me? Thanks!
Hi there,What IDE are you using (e.g. Eclipse, IntelliJ)? Are you coding and then running your app through the IDE?
If you are running your app through the IDE, something to be aware of is that most Java IDE's define their own classpath and by default don't use the CLASSPATH environment variable you set up in Windows.
To fix your problem, you need to configure the classpath used by your IDE so that it includes the sqljdbc.jar file.
If you're not sure how to do this then consult the doco that came with the IDE but if it's no help give us a buzz and we can probably work something out (I'm only familiar with Eclipse and IntelliJ though).
Hope that helps a bit, but sorry if it doesn't.
|||
Hi and thanks for your time,
I'm not using any kind of IDE. I've used to program with Eclipse but I'm not allow to do that now. With Eclipse I had add jar files other times without problems.I have to ask for it and I had this as my last solution.
So I'm doing it with a simple text editor and my JVM compiling everytime I want to. Then I open my applet with my internet explorer and that's when I get my error.
I'm looking for a solution with this conditions. Thanks
|||Hi thereI'm quite sure my problem is CLASSPATH, because I've found some examples where is tested my line code error and, in the catch block there is always a report like "You haven't registered SQL Server 2000 in the classpath" or so.
In my case, I have just add .jar file containing the driver, to the CLASSPATH variable. Does is it correct?
Thanks!
|||Yes, if the sqljdbc.jar file is not in the classpath then it needs to be there (if that's what you're asking).
So your classpath variable should be something like:
%classpath%;C:\JDBC\sqljdbc.jar
|||I've found another solution, and it seems to be working ok. Instead of using directly a new JDBC driver, I'm using the JDBC-ODBC generic bridge, so in the calling I should write
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
The only thing I' have to take in account is that I must give permissions to the applet in order to be able to get that driver and use the classes. I can do that if I modify my java.policy file.
|||
Hmmm, this may be a year too late, but for the sake of others running into the same problem...
First, I've had better luck getting the sqljdbc driver to work with SQL Server 2005, using
DriverManager.registerDriver(new com.microsoft.sqlserver.jdbc.SQLServerDriver());
rather than
Class.forName(...)
Second, I couldn't get this to work until I put an "ARCHIVE" parameter in the tag, referring specifically to the sqljdbc.jar:
<APPLET CODE="jdbcTest.class" ARCHIVE=sqljdbc.jar>
Next, I ran into a problem with running the applet from a web server that is *separate* from a remote database server (whose IP and port, below, I have changed in the interest of security):
Exception in thread "Thread-73" java.security.AccessControlException: access denied (java.net.SocketPermission 123.235.12.43:1234 connect,resolve)
As mentioned, the solution to this is to create a policy file, in this example named "jdbcTest.pol", that gives the applet the necessary permissions:
grant
{
permission java.net.SocketPermission "123.235.12.43:1234", "connect,resolve";
};
The problem with this seems to be that although it works when run under appletviewer, by specifying the policy file:
appletviewer -J-Djava.security.policy=jdbcTest.pol jdbcTest.html
It DOES NOT work when run in a browser! There does not seem to be a way to specify the policy file (for instance, as a parameter in the <APPLET> tag). A possible solution to this might be referred to in this snippet from the Java security FAQ:
"How can an applet open a network connection to a computer on the internet?
Applets are not allowed to open network connections to any computer, except for the host that provided the .class files. This is either the host where the html page came from, or the host specified in the codebase parameter in the applet tag, with codebase taking precendence."
So, it sounds like it might be possible to set the CODEBASE parameter to point to the remote database server (point to what, exactly, though?) or to have a page on the web server load the jdbcTest.class from a location on the remote database server. But I haven't got any of this to work yet! I'll post something here if I do. Otherwise, I'd be happy to hear from anyone who has got this to work.
The question is: Is it possible, given the security restrictions, to connect to a SQL Server running on a remote host from an applet running on a separate web server? If so, how?
Connecting jdbc driver from an applet
Hi,
I've found problems when executing
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
I get a java.lang.ClassNotFoundException, and I have done this steps:
1o I got the driver from msdn web page
2o I modified the classpath in Windows XP adding the path to the sqljdbc.jar, testing if there was any problems with blanks in the path, I tried to put the .jar file in a more simple folder, but it didn't work.
Perhaps I've to do something whith my policy.java or so archives to let applets do something about this but I have no idea.
Can someone help me? Thanks!
Hi there,What IDE are you using (e.g. Eclipse, IntelliJ)? Are you coding and then running your app through the IDE?
If you are running your app through the IDE, something to be aware of is that most Java IDE's define their own classpath and by default don't use the CLASSPATH environment variable you set up in Windows.
To fix your problem, you need to configure the classpath used by your IDE so that it includes the sqljdbc.jar file.
If you're not sure how to do this then consult the doco that came with the IDE but if it's no help give us a buzz and we can probably work something out (I'm only familiar with Eclipse and IntelliJ though).
Hope that helps a bit, but sorry if it doesn't.
|||
Hi and thanks for your time,
I'm not using any kind of IDE. I've used to program with Eclipse but I'm not allow to do that now. With Eclipse I had add jar files other times without problems.I have to ask for it and I had this as my last solution.
So I'm doing it with a simple text editor and my JVM compiling everytime I want to. Then I open my applet with my internet explorer and that's when I get my error.
I'm looking for a solution with this conditions. Thanks
|||Hi thereI'm quite sure my problem is CLASSPATH, because I've found some examples where is tested my line code error and, in the catch block there is always a report like "You haven't registered SQL Server 2000 in the classpath" or so.
In my case, I have just add .jar file containing the driver, to the CLASSPATH variable. Does is it correct?
Thanks!
|||Yes, if the sqljdbc.jar file is not in the classpath then it needs to be there (if that's what you're asking).
So your classpath variable should be something like:
%classpath%;C:\JDBC\sqljdbc.jar
|||I've found another solution, and it seems to be working ok. Instead of using directly a new JDBC driver, I'm using the JDBC-ODBC generic bridge, so in the calling I should write
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
The only thing I' have to take in account is that I must give permissions to the applet in order to be able to get that driver and use the classes. I can do that if I modify my java.policy file.
|||
Hmmm, this may be a year too late, but for the sake of others running into the same problem...
First, I've had better luck getting the sqljdbc driver to work with SQL Server 2005, using
DriverManager.registerDriver(new com.microsoft.sqlserver.jdbc.SQLServerDriver());
rather than
Class.forName(...)
Second, I couldn't get this to work until I put an "ARCHIVE" parameter in the tag, referring specifically to the sqljdbc.jar:
<APPLET CODE="jdbcTest.class" ARCHIVE=sqljdbc.jar>
Next, I ran into a problem with running the applet from a web server that is *separate* from a remote database server (whose IP and port, below, I have changed in the interest of security):
Exception in thread "Thread-73" java.security.AccessControlException: access denied (java.net.SocketPermission 123.235.12.43:1234 connect,resolve)
As mentioned, the solution to this is to create a policy file, in this example named "jdbcTest.pol", that gives the applet the necessary permissions:
grant
{
permission java.net.SocketPermission "123.235.12.43:1234", "connect,resolve";
};
The problem with this seems to be that although it works when run under appletviewer, by specifying the policy file:
appletviewer -J-Djava.security.policy=jdbcTest.pol jdbcTest.html
It DOES NOT work when run in a browser! There does not seem to be a way to specify the policy file (for instance, as a parameter in the <APPLET> tag). A possible solution to this might be referred to in this snippet from the Java security FAQ:
"How can an applet open a network connection to a computer on the internet?
Applets are not allowed to open network connections to any computer, except for the host that provided the .class files. This is either the host where the html page came from, or the host specified in the codebase parameter in the applet tag, with codebase taking precendence."
So, it sounds like it might be possible to set the CODEBASE parameter to point to the remote database server (point to what, exactly, though?) or to have a page on the web server load the jdbcTest.class from a location on the remote database server. But I haven't got any of this to work yet! I'll post something here if I do. Otherwise, I'd be happy to hear from anyone who has got this to work.
The question is: Is it possible, given the security restrictions, to connect to a SQL Server running on a remote host from an applet running on a separate web server? If so, how?
Friday, February 17, 2012
Connecting (ODBC) to SQL 2005 Express from different domain with trust
Hi!
I am trying to establish connection from different domain using ODBC driver with no luck!
I am able to do it within my domain from any place, but it fails from outside. I have two-ways trust established between domains. Users are able to see and use resources both ways.
When I create ODBC it doesn't matter if I use SQL or Windows NT authenctication, I am getting error:
Connection Failed:
SQLState: '01000'
SQLServer Error: 11004
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]Connection Open (getbyhostname()() )
Connectio Failed:
SQLState: '08001'
SQL Server Error: 11
I tried to set it with TCP Static Port or Dynamic. No difference.
What should I look into?
Any ideas? Any help?
Thanks.
Did you try using the ip address ? Maybe the name cannot be resolved ?
Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Yes I tried. Does SQl 2005 Express have any limitations as far as Connections from other domains?
Any other ideas.
|||No, it don′t has such things. Is the server pingable ? SQL Server uses a dynamic port not he standard port. The SQL Server browser service will redirect incoming request to the appripiate dynamic port. Therefore the service has to be started on the server system. Did you check that ?
Jens K. Suessmeyer
http://www.sqlserver2005.de
I am able to ping server, able to access files on server using UNC.
SQL Server browser is running on my server. Everything is in place, yet I can't logon.
I tried setting up ODBC Data Source with both Windows NT and SQL account authentication with no luck.
SQL actually is letting me create login using user name from other domain. I can do Find and discover users from other domain.
When it gets to making connection with server from their side it just dont see it.
Is that possible that because server is installed as a named instance I am having that problem?
|||There has to be a firewall in between which block the traffic (bit not ICMP). Make sure you configured the firewall to let the appropiate ports open for connecting.
Jens K. Suessmeyer
http://www.sqlserver2005.de
Connecting (ODBC) to SQL 2005 Express from different domain with trust
Hi!
I am trying to establish connection from different domain using ODBC driver with no luck!
I am able to do it within my domain from any place, but it fails from outside. I have two-ways trust established between domains. Users are able to see and use resources both ways.
When I create ODBC it doesn't matter if I use SQL or Windows NT authenctication, I am getting error:
Connection Failed:
SQLState: '01000'
SQLServer Error: 11004
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]Connection Open (getbyhostname()() )
Connectio Failed:
SQLState: '08001'
SQL Server Error: 11
I tried to set it with TCP Static Port or Dynamic. No difference.
What should I look into?
Any ideas? Any help?
Thanks.
Did you try using the ip address ? Maybe the name cannot be resolved ?
Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Yes I tried. Does SQl 2005 Express have any limitations as far as Connections from other domains?
Any other ideas.
|||No, it don′t has such things. Is the server pingable ? SQL Server uses a dynamic port not he standard port. The SQL Server browser service will redirect incoming request to the appripiate dynamic port. Therefore the service has to be started on the server system. Did you check that ?
Jens K. Suessmeyer
http://www.sqlserver2005.de
I am able to ping server, able to access files on server using UNC.
SQL Server browser is running on my server. Everything is in place, yet I can't logon.
I tried setting up ODBC Data Source with both Windows NT and SQL account authentication with no luck.
SQL actually is letting me create login using user name from other domain. I can do Find and discover users from other domain.
When it gets to making connection with server from their side it just dont see it.
Is that possible that because server is installed as a named instance I am having that problem?
|||There has to be a firewall in between which block the traffic (bit not ICMP). Make sure you configured the firewall to let the appropiate ports open for connecting.
Jens K. Suessmeyer
http://www.sqlserver2005.de
Connecting (ODBC) to SQL 2005 Express from different domain with trust
Hi!
I am trying to establish connection from different domain using ODBC driver with no luck!
I am able to do it within my domain from any place, but it fails from outside. I have two-ways trust established between domains. Users are able to see and use resources both ways.
When I create ODBC it doesn't matter if I use SQL or Windows NT authenctication, I am getting error:
Connection Failed:
SQLState: '01000'
SQLServer Error: 11004
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]Connection Open (getbyhostname()() )
Connectio Failed:
SQLState: '08001'
SQL Server Error: 11
I tried to set it with TCP Static Port or Dynamic. No difference.
What should I look into?
Any ideas? Any help?
Thanks.
Did you try using the ip address ? Maybe the name cannot be resolved ?
Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Yes I tried. Does SQl 2005 Express have any limitations as far as Connections from other domains?
Any other ideas.
|||No, it don′t has such things. Is the server pingable ? SQL Server uses a dynamic port not he standard port. The SQL Server browser service will redirect incoming request to the appripiate dynamic port. Therefore the service has to be started on the server system. Did you check that ?
Jens K. Suessmeyer
http://www.sqlserver2005.de
I am able to ping server, able to access files on server using UNC.
SQL Server browser is running on my server. Everything is in place, yet I can't logon.
I tried setting up ODBC Data Source with both Windows NT and SQL account authentication with no luck.
SQL actually is letting me create login using user name from other domain. I can do Find and discover users from other domain.
When it gets to making connection with server from their side it just dont see it.
Is that possible that because server is installed as a named instance I am having that problem?
|||There has to be a firewall in between which block the traffic (bit not ICMP). Make sure you configured the firewall to let the appropiate ports open for connecting.
Jens K. Suessmeyer
http://www.sqlserver2005.de
Tuesday, February 14, 2012
Connect to Sybase in a DTS Package
Thanks.You must install sybase client package which included network communication files,odbc driver,oledb driver first.
Then you must create a database alias in dsedit same as client network configuration tools of SQL Server.Please remember the communication port of sybase is 4100.Test if it works well. see pic-1
Then,you need create an odbc connection in odbc manager.Please fill with the alias name which has been named in dsedit in server name input-box. see pic-2
And now,you can choose other connection using sybase odbc driver in DTS package designing. see pic-3|||Picture-1,2,3