http://www.perlmonks.org?node_id=1018353


in reply to Connecting to sqlserver2008 - DBD::Sybase connectivity and unixODBC issue

venu_hs:

Do you really have an SQL Server ODBC driver on your unix box? Or are you using something like FreeTDS? You need to be sure you're specifying the correct driver name, or you can get an error like that.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re: Connecting to sqlserver2008 - DBD::Sybase connectivity and unixODBC issue

Replies are listed 'Best First'.
Re^2: Connecting to sqlserver2008 - DBD::Sybase connectivity and unixODBC issue
by venu_hs (Novice) on Feb 14, 2013 at 00:48 UTC

    When i give odbcinst -j, it gives me drivers,system data resources and other details. when i give odbcinst -q -d, the o/p is SQL Server Native Client 11.0 Can you please post some links realted to this connectivity with valid info..

      venu_hs:

      I generally google for connection strings and come up with a page like: http://www.connectionstrings.com/sql-server-2008, then start trying variations on the connection strings. If you look at the error messages and/or tracing information (see http://search.cpan.org/~mjevans/DBD-ODBC-1.41/ODBC.pm#Tracing), the error messages generally guide you to the incorrect parameter.

      For example, assuming everything is set up properly, and you're getting the original message "Requested server name not found", then I'd look at the spelling of the server name you specified. If the spelling is correct and you're using a name rather than IP address, I'd try pinging the name using the same account your program runs under to see if it can access the machine.

      Unfortunately, there are so many different settings and potential connection issues, that it's rather hard to guide you through them. So start with the basics.

      I'd suggest starting with DBI turn on as much diagnostic tracing as possible, and then ask it to enumerate the drivers it knows about. Once you're sure it's listing ODBC, then ask it what ODBC data sources are available. If it lists any, try to connect to one and see what sort of diagnostics you get.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.