freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] MS SQL Server - connecting to named instancewithfreetds/DBD::Sybase?
- From: "Lowden, James K" <LowdenJK AT bernstein.com>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] MS SQL Server - connecting to named instancewithfreetds/DBD::Sybase?
- Date: Fri, 8 Jul 2005 11:55:17 -0400
> From: Curt Kiser
> Sent: Friday, July 08, 2005 7:53 AM
>
> If you are using a copy of SQL Server Personal Edition for your
> local copy the TDS protocol version for personal is different than
> Standard/Enterprise. You would need to compile FreeTDS using
> -with-tdsver=8.0. That should take care of your incorrect login
> problem.
Or if not recompile, indicate the TDS protocol in freetds.conf or
TDSVER.
> -----Original Message-----
> From: Knut Brobakken
> Sent: Friday, July 08, 2005 4:10 AM
...
> I have built, installed and tested freetds (v 0.63, TDS version
> 5.0 with MS db-lib compatibility), and have successfully connected
> to and queried my local SQL Server, both using tsql and using
> DBD::Sybase from perl.
Your local SQL Server is by Microsoft and accepts TDS 5.0 connections?
> My user only has access to one particular instance and database,
> and I get "incorrect login" when I try connecting to the server
> using the following code:
>
> #!/usr/bin/perl
>
> use strict;
>
> use DBI;
> my $server = "101.64.2.5";
> my $port = "1433";
1433 is the default port. Your named instance may be on another port.
> I have also tried connecting using tsql from the command line with
> -H 101.64.2.5, -p 1433 and -U pubusr_102, and I get only "login
> failed for user pubusr_102".
That command bypasses freetds.conf, so your TDS protocol version (7.0 or
8.0) has to be either compiled in or set in TDSVER.
> What is the correct syntax for specifying the instance name and
> database in the connect string from DBD?
An instance name is just dataserver entry in freetds.conf: a tcp/ip
address (or DNS name), a port, and a protocol version.
In the next release (or the current snapshot), you'll be able to name
your instance in freetds.conf. The current UG describes how. But the
server doesn't use the instance name at connection time! What's really
happening is that the server runs a kind of mini-DNS: we issue a query
to iirc 1434 asking for the port assigned to a given name, then we
connect to the port. If we know the port in advance, we can skip the
interrogation.
> And is there a way to provide the instance name to tsql to test
> this from the command line?
No. If the instance is named in freetds.conf and you don't bypass it
with tsql, it will of course use the information. But there's no new
tsql parameter to override it; you just indicate the addrees & port
instead.
HTH.
--jkl
-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named
above. If you are not the intended recipient, or an employee or agent
responsible
for delivering this message to the intended recipient, any review,
dissemination,
distribution or duplication of this communication is strictly prohibited. If
you are
not the intended recipient, please contact the sender immediately by reply
and destroy all copies of the original message. Please note that we do not
accept
account orders and/or instructions by e-mail, and therefore will not be
responsible
for carrying out such orders and/or instructions. If you, as the intended
recipient
of this message, the purpose of which is to inform and update our clients,
prospects
and consultants of developments relating to our services and products, would
not
like to receive further e-mail correspondence from the sender, please "reply"
to the
sender indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New
York,
NY 10105.
- Re: [freetds] MS SQL Server - connecting to named instancewithfreetds/DBD::Sybase?, Lowden, James K, 07/08/2005
Archive powered by MHonArc 2.6.24.