[freetds] Connecting to an SQL 2005 server in a windows 2000 machine[Scanned]

Javier Oviedo joviedo at plcendesa.com
Mon Jan 30 10:16:28 EST 2006


michael.peppler at bnpparibas.com wrote:

>What that means is that the host/port that you are using is incorrect -
>there is no SQL server listening at that address.
>
>Double-check the IP address of the SQL server host...
>
>Michael
>
>
>
>
>Internet
>joviedo at plcendesa.com@lists.ibiblio.org - 30/01/2006 15:16
>
>
>Please respond to freetds at lists.ibiblio.org
>
>Sent by:    freetds-bounces at lists.ibiblio.org
>
>To:    freetds
>
>cc:
>
>
>Subject:    Re: [freetds] Connecting to an SQL 2005 server in a windows
>       2000 machine[Scanned]
>
>
>Pascal MIQUET wrote:
>
>  
>
>>Hi,
>>
>>You try to connect to an MS SQL server using the DBI:Sybase driver ???
>>Before you try you code, did you test that the connection to your SQL
>>    
>>
>Server is correctly setted ?
>  
>
>>You can try using the tsql command.
>>
>>HTH
>>Regards
>>Pascal
>>
>>-----Message d'origine-----
>>De : freetds-bounces at lists.ibiblio.org
>>    
>>
>[mailto:freetds-bounces at lists.ibiblio.org] De la part de Javier Oviedo
>  
>
>>Envoyé : dimanche 29 janvier 2006 13:25
>>À : FreeTDS Development Group
>>Objet : [freetds] Connecting to an SQL 2005 server in a windows 2000
>>    
>>
>machine[Scanned]
>  
>
>>Hi all
>>I triying to connect my linux system (RHEL 3)  to an SLQ server in a
>>    
>>
>windows 2000 machine. I have the following packages installed in my linux
>system:
>  
>
>>DBI-1.48
>>freetds-0.63
>>DBD-Sybase-1.07
>>
>>The drivers installed are:
>>
>>DBM, ExampleP, File, Pg, Proxy, Sponge, Sybase, mysql
>>
>>My freetds conf :
>>
>>[sqlexpress]
>>       host = X.X.X.X
>>       port = 1433
>>       tds version = 8.0
>>
>>
>>My DBI->connect:
>>
>>my $dbh = DBI->connect("DBI:Sybase:server=sqlexpress", $user, $passwd,
>>    
>>
>{PrintError => 0});
>  
>
>>I obtain the following error when I execute my perl script:
>>
>>  DBI 1.48-ithread default trace level set to 0x0/4 (pid 28344)
>>   ->
>>DBI->connect(DBI:Sybase:server=sqlexpress;database=Gateway101SNMP, sa,
>>****, HASH(0x9551bdc))
>>   -> DBI->install_driver(Sybase) for linux perl=5.008 pid=28344 ruid=0
>>    
>>
>euid=0
>  
>
>>   syb_init() -> DBD::Sybase 1.07 initialized
>>   OpenClient version: freetds v0.63
>>      install_driver: DBD::Sybase version 1.07 loaded from
>>    
>>
>/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DBD/Sybase.pm
>  
>
>>   New DBI::dr (for DBD::Sybase::dr, parent=, id=)
>>   dbih_setup_handle(DBI::dr=HASH(0x965d420)=>DBI::dr=HASH(0x96ed1e0),
>>DBD::Sybase::dr, 0, Null!)
>>   dbih_make_com(Null!, 0, DBD::Sybase::dr, 84, 0) thr#9551008
>>   <- install_driver= DBI::dr=HASH(0x965d420)
>>   !! warn: 0 CLEARED by call to connect method
>>   -> connect for DBD::Sybase::dr (DBI::dr=HASH(0x965d420)~0x96ed1e0
>>'server=sqlexpress;database=Gateway101SNMP' 'sa' **** HASH(0x96eeeb8))
>>thr#9551008
>>   New DBI::db (for DBD::Sybase::db, parent=DBI::dr=HASH(0x96ed1e0), id=)
>>   dbih_setup_handle(DBI::db=HASH(0x96ed1c8)=>DBI::db=HASH(0x96eeef4),
>>DBD::Sybase::db, 965d174, Null!)
>>   dbih_make_com(DBI::dr=HASH(0x96ed1e0), 9612f10, DBD::Sybase::db, 2716,
>>    
>>
>0) thr#9551008
>  
>
>>   syb_db_login() -> using global CS_LOCALE data
>>src/tds/login.c: tds_connect: 172.25.97.140:1433: Connection refused
>>   clientmsg_cb -> Server is unavailable or does not exist.
>>   <> DESTROY(DBI::db=HASH(0x96ed1c8)) ignored for outer handle (inner
>>DBI::db=HASH(0x96eeef4) has ref cnt 1)
>>   -> DESTROY for DBD::Sybase::db (DBI::db=HASH(0x96eeef4)~INNER)
>>thr#9551008
>>        DESTROY for DBI::db=HASH(0x96eeef4) ignored - handle not
>>    
>>
>initialised
>  
>
>>      ERROR: 41 'OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY =
>>    
>>
>(78) NUMBER = (41) Server sqlexpress, database Message String: Server is
>unavailable or does not exist.
>  
>
>>' (err#0)
>>   <- DESTROY= undef at DBI.pm line 598
>>   dbih_clearcom 0x96ed1c8 (com 0x96ef740, type 2) done.
>>
>>   !! ERROR: 41 'OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY =
>>    
>>
>(78) NUMBER = (41) Server sqlexpress, database Message String: Server is
>unavailable or does not exist.
>  
>
>>' (err#0)
>>   <- connect= undef at DBI.pm line 598
>>   -> $DBI::errstr (&) FETCH from lasth=HASH
>>   >> DBD::Sybase::dr::errstr
>>   <- $DBI::errstr= 'OpenClient message: LAYER = (0) ORIGIN = (0)
>>    
>>
>SEVERITY = (78) NUMBER = (41) Server sqlexpress, database Message String:
>Server is unavailable or does not exist.
>  
>
>>'
>>      DBI connect('server=sqlexpress;database=Gateway101SNMP','sa',...)
>>failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78)
>>    
>>
>NUMBER = (41) Server sqlexpress, database Message String: Server is
>unavailable or does not exist.
>  
>
>>Can't call method "do" on an undefined value at joe.pl line 15.
>>   -- DBI::END
>>   !! ERROR: 41 CLEARED by call to disconnect_all method
>>   -> disconnect_all for DBD::Sybase::dr
>>(DBI::dr=HASH(0x965d420)~0x96ed1e0) thr#9551008
>>   <- disconnect_all= 1 at DBI.pm line 677 via joe.pl line 0
>>!   -> DESTROY in DBD::_::common for DBD::Sybase::dr
>>(DBI::dr=HASH(0x96ed1e0)~INNER) thr#9551008
>>!   <- DESTROY= undef during global destruction
>>   dbih_clearcom 0x965d420 (com 0x9612f10, type 1) done.
>>
>>!   <> DESTROY for DBI::dr=HASH(0x965d420) ignored (inner handle gone)
>>
>>The SQL Server works fine and it listening on 1433 port. I can connect it
>>    
>>
>with my SQL 2005 Manager and Toad.
>  
>
>>Any Ideas?
>>
>>Thanks in advance!
>>Regards
>>_______________________________________________
>>FreeTDS mailing list
>>FreeTDS at lists.ibiblio.org
>>http://lists.ibiblio.org/mailman/listinfo/freetds
>>_______________________________________________
>>FreeTDS mailing list
>>FreeTDS at lists.ibiblio.org
>>http://lists.ibiblio.org/mailman/listinfo/freetds
>>
>>
>>
>>
>>    
>>
>Hi pascal
>When I execute tsql to test the connection I obtain the following error:
>
> tsql -H 172.25.X.X -p 1433 -U **
>locale is "en_US.UTF-8"
>locale charset is "UTF-8"
>Password:
>src/tds/login.c: tds_connect: 172.25.X.X:1433: Connection refused
>Msg 20009, Level 9, State 0, Server OpenClient, Line 0
>Server is unavailable or does not exist.
>There was a problem connecting to the server
>
>Have you an other idea to connect to SQL server from linux. I need use
>perl from linux.
>Regards!
>
>
>_______________________________________________
>FreeTDS mailing list
>FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
>
>
>This message and any attachments (the "message") is
>intended solely for the addressees and is confidential. 
>If you receive this message in error, please delete it and 
>immediately notify the sender. Any use not in accord with 
>its purpose, any dissemination or disclosure, either whole 
>or partial, is prohibited except formal approval. The internet
>can not guarantee the integrity of this message. 
>BNP PARIBAS (and its subsidiaries) shall (will) not 
>therefore be liable for the message if modified. 
>
>                ---------------------------------------------
>
>Ce message et toutes les pieces jointes (ci-apres le 
>"message") sont etablis a l'intention exclusive de ses 
>destinataires et sont confidentiels. Si vous recevez ce 
>message par erreur, merci de le detruire et d'en avertir 
>immediatement l'expediteur. Toute utilisation de ce 
>message non conforme a sa destination, toute diffusion 
>ou toute publication, totale ou partielle, est interdite, sauf 
>autorisation expresse. L'internet ne permettant pas 
>d'assurer l'integrite de ce message, BNP PARIBAS (et ses
>filiales) decline(nt) toute responsabilite au titre de ce 
>message, dans l'hypothese ou il aurait ete modifie.
>
>_______________________________________________
>FreeTDS mailing list
>FreeTDS at lists.ibiblio.org
>http://lists.ibiblio.org/mailman/listinfo/freetds
>
>
>  
>
Hi michael

I check my SQL Server configuration and it listen on port 1433 and ip 
172.25.X.X . I can connecto to SQL from my laptop with Toad and SQL 2005
Manager.
This is the output from tsql -C:

 tsql -C
Compile-time settings (established with the "configure" script):
                           Version: freetds v0.63
    MS db-lib source compatibility: no
       Sybase binary compatibility: unknown
                     Thread safety: yes
                     iconv library: yes
                       TDS version: 8.0
                             iODBC: yes
                          unixodbc: no

Regards


More information about the FreeTDS mailing list