[unixODBC-support] RE: Problems with freetds and unixodbc

Brian Morton bmorton at secureworks.com
Thu Dec 8 14:23:19 GMT 2005


I think it should be finding them since this is debian and I used the -dev
packages (header files) that correspond to the package I have installed to
compile rlib.  I will try strace.  Thanks. 

-----Original Message-----
From: Stefan Radman [mailto:Stefan.Radman at ctbto.org] 
Sent: Thursday, December 08, 2005 3:39 AM
To: Support for the unixODBC project
Subject: RE: [unixODBC-support] RE: Problems with freetds and unixodbc

You're right.

The Error you see ("Data source name not found and no default driver
specified") happens at a pretty early state (IM002) and indicates that the
driver manager cannot find your DSN and consequently doesn't find the driver
associated with it.
Looks like it does not find your configuration (files).

Hint: Make sure that rlib.so is (dynamically) linked to the same unixODBC
instance that php and odbcinst are using.
"strace" might help isolating the problem.

Good luck

Stefan

> -----Original Message-----
> From: unixodbc-support-bounces at easysoft.com
> [mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of Brian 
> Morton
> Sent: Wednesday, 07 December, 2005 19:51
> To: 'Support for the unixODBC project'
> Cc: 'Bob Doan'
> Subject: RE: [unixODBC-support] RE: Problems with freetds and unixodbc
> 
> I have run tests with php using standard odbc_connect calls, and it 
> succeeds.  I think the problem lies with the package I am trying to 
> use.
> Not an odbc issue it seems. 
> 
> -----Original Message-----
> From: Brian Morton
> Sent: Wednesday, December 07, 2005 12:57 PM
> To: 'Support for the unixODBC project'
> Cc: 'Bob Doan'
> Subject: RE: [unixODBC-support] RE: Problems with freetds and unixodbc
> 
> So here's what I've run into in this process.  It is not a problem 
> with setup as much as a problem with usage (I want to make sure 
> everything works before I make the tutorial).  My driver is registered 
> via odbcinst and my datasource is as well.  I can see them both by 
> doing odbcinst -q -s or -d.
> Isql connects to my datasource with no problem.  However, I cannot 
> connect to the datasource via php.  This is a package called Rlib for 
> php that does reporting.
> 
> majorpacketloss:/var/www/apache2-default/rlib# php 
> /var/www/apache2-default/rlib/odbc.php
> SQLError = [unixODBC][Driver Manager]Data source name not found, and 
> no default driver specified Error SQLConnect -1 [[unixODBC][Driver 
> Manager]Data source name not found, and no default driver specified]
> ERROR: Could not connect to ODBC
> 
> But the DSN I am using is clearly registered.  I know this isn't a php 
> mailing list, but has anyone seen anything like this before?
> 
> -----Original Message-----
> From: Stefan Radman [mailto:Stefan.Radman at ctbto.org]
> Sent: Wednesday, December 07, 2005 11:34 AM
> To: Support for the unixODBC project
> Subject: RE: [unixODBC-support] RE: Problems with freetds and unixodbc
> 
> Hi Brian,
> 
> Thanks for volunteering to write the HOWTO.
> Below you'll find a summary of my findings.
> Use it and distill it as you like ;-)
> 
> Cheers
> Stefan
> 
> ========================================================
> The ODBC-only configuration does not need any FreeTDS configuration 
> files or environment variables.
> It lives and works solely from the configuration found in odbc.ini and 
> odbcinst.ini.
> 
> Here is a sample configuration that worked very well for me on Solaris 
> and Linux with unixODBC 2.2.9 and FreeTDS ODBC driver 0.62.3:
> 
> FreeTDS driver entry in odbcinst.ini:
> -------------------------------------
> [FreeTDS]
> Description=FreeTDS ODBC Driver for Sybase and MS-SQL 
> Driver=/usr/lib/libtdsodbc.so Setup=/usr/lib/libtdsodbc.so
> UsageCount=1
> 
> DSN entry in odbc.ini:
> ----------------------
> [testdb]
> Description     = Test Sybase Database with FreeTDS
> Driver          = FreeTDS
> Server          = sybase.example.com
> Port            = 5050
> TDS_Version     = 5.0
> Database        = testdb
> 
> 
> unixODBC has two handy tools for adding these entries:
>   1) the "ODBCConfig" GUI and
>   2) the "odbcinst" command line tool 
>      for non-interactive processing (e.g. odbcinst -i -d -r)
> 
> 
> Valid attributes for use in odbc.ini (or the connection
> string) can be found
> at:
>   http://www.freetds.org/userguide/odbcconnattr.htm
> 
> For ODBC-only configurations these are:
> 
>   Server       database server DNS hostname or IP address
>   Port         TCP port the database server is listening
>   TDS_Version
> http://www.freetds.org/userguide/choosingtdsprotocol.htm#TAB.P
> ROTOCOL.BY
> .PRODUCT
>   Database     databse name on the server
>   APP
>   LANGUAGE
>   TextSize
>   PacketSize
>   Address
> 
> Note: 
> * do NOT use "Servername" in an ODBC-only configuration!
> * use of "Server" should be preferred over "Address"
>   (see
> http://lists.ibiblio.org/pipermail/freetds/2004q2/016086.html et
> al)
> 
> A summary of the Q&A regarding "Server","Servername" and "Address" 
> would help people a great deal.
> 
> What I haven't found is a comprehensive reference about the default 
> TCP port numbers that different versions of Microsoft and Sybase SQL 
> Server
> use:
> 
>   http://www.iana.org/assignments/port-numbers
>     ms-sql-s        1433/tcp   Microsoft-SQL-Server 
>     sybase-sqlany   1498/tcp    Sybase SQL Any
> 
>  
> http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html
> _single/Sy
> base-ASE-HOWTO.html#AEN382  
>     4100 Sybase ASE SQL Server default
>     2025 old Sybase ASE SQL Server default??
> 
> 
> > -----Original Message-----
> > From: unixodbc-support-bounces at easysoft.com
> > [mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of Brian 
> > Morton
> > Sent: Wednesday, 07 December, 2005 15:26
> > To: 'unixodbc-support at easysoft.com'
> > Subject: [unixODBC-support] RE: Problems with freetds and unixodbc
> > 
> > I read the FreeTDS article I was sent about the three possible 
> > configuration options for FreeTDS and ODBC.  Can anyone shed some 
> > light on tips for the only ODBC method?  I have done pure
> FreeTDS, and
> > also done the config file mix, which is the one documented on 
> > unixODBC's site.  How do I do it with ODBC being the only
> connection
> > method?  Once I figure it out, I will write a howto for the site.
> > 
> > >  -----Original Message-----
> > > From: 	Brian Morton  
> > > Sent:	Tuesday, December 06, 2005 10:59 AM
> > > To:	'unixodbc-support at easysoft.com'
> > > Subject:	Problems with freetds and unixodbc
> > > 
> > > I have a Debian 3.1 machine with FreeTDS and unixODBC
> > installed.  I am
> > > able to connect to my MSSQL 2000 server via tsql (which is
> > the command
> > > line interface for FreeTDS).  However, I cannot connect via
> > isql or any
> > > odbc connect functions in PHP.  I have read the HOWTO on
> this on the
> > > unixODBC site, but it has not helped me.  Where can I begin to 
> > > troubleshoot my problems between FreeTDS and unixODBC?
> > Thanks for your
> > > help in advance.
> > > 
> > > Brian Morton
> > > 
> > > CRM Developer
> > > SecureWorks, Inc.
> > > 11 Executive Park Drive
> > > Atlanta, GA 30329
> > > tel  (404) 417-3728
> > > fax (404) 327-8835
> > > www.secureworks.com
> > > 
> > _______________________________________________
> > unixODBC-support mailing list
> > unixODBC-support at easysoft.com
> > http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> > 
> > 
> 
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> 
> 

_______________________________________________
unixODBC-support mailing list
unixODBC-support at easysoft.com
http://mail.easysoft.com/mailman/listinfo/unixodbc-support



More information about the unixODBC-support mailing list