DBD::ODBC, unixODBC, FreeTDS, MS-SQL, lazy DL, dbd_db_login/SQLSetConnectOption err=-2

From: Honza Pazdziora (adelton_at_fi.muni.cz)
Date: 01/04/05


Date: Tue, 4 Jan 2005 09:55:20 +0100
To: dbi-users@perl.org


Hello,

I have succesfully installed

        freetds-0.62.3-1.1.fc3.rf from Dag Wieers's rpm repository
        unixODBC-2.2.9-42
        unixODBC-devel-2.2.9-42 from Fedora Core 3's rpm repository
        DBD::ODBC 1.13 from sources from CPAN

on top of

        perl, v5.8.3 built for i386-linux-thread-multi
                                        from FC3's perl-5.8.3-5 rpm

The make test did not go especially well but that was caused by me not
having enough priviledges on the remote MS-SQL. Accessing the remote
MS-SQL from Linux box is my goal.

My scripts only work if I add PERL_DL_NONLAZY=1 environment setting
before starting my perl scripts that use DBD::ODBC -> unixODBC ->
freetds -> MS-SQL. Without the PERL_DL_NONLAZY=1, the connect to the
remote server fails with

        DBD: dbd_db_login/SQLSetConnectOption err=-2

Searching the web and archives, the problem is documented in
Easysoft.com's

        http://www.easysoft.com/products/9999/faq_answer.phtml?ID=664&product=2002
        Why do I get "SQLSetConnectOption err=-2" errors in my Perl
        scripts

However, adding --enable-rtldgroup=yes to unixODBC's configure nor
fiddling with flags passed to dlopen in sys_dl_open function did not
yield change in behaviour -- PERL_DL_NONLAZY=1 makes the connect (and
everything after that, including character sets, etc.) work, without
PERL_DL_NONLAZY=1 I get the SQLSetConnectOption err=-2 error.

I am not sure yet whether the problem really is in Perl, unixODBC or
DBD::ODBC. However, as it first appeared after I used DBD::ODBC,
I thought I ask in dbi-users -- does anyone experience the similar
problem? Or, does anyone use the combination of software mentioned
above (or similar) to work successfully with MS-SQL from Linux? Is
there any way to force the PERL_DL_NONLAZY=1 from inside Perl script,
so that I would put in into ODBC.pm and save myself the trouble of
wrapping all scripts with the environment setting?

I can of course send straces / other logs I someone things they should
be usefull.

Thank you for any hint,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
 .project: Perl, mod_perl, DBI, Oracle, large Web systems, XML/XSL, ...
		Only self-confident people can be simple.


Relevant Pages

  • Re: Remote Computers / Users and Scripts
    ... My remote users connect to my Domain via windows 2003 RAS VPN. ... When they first turn on the computer there are Group Policy scripts bound to ... Some times these startup scripts run for a very long time, ...
    (microsoft.public.windows.server.active_directory)
  • Regarding a selection for mobile code/scripting language
    ... reasonably efficient robustness for administration and security functions. ... of the framework completed as described in my "Treatise on Informational ... Fun stuff like remote registry control, remote program execution, ... I want to have lots of mobile scripts that perform generalized ...
    (Vuln-Dev)
  • RE: Connecting to remote servers with scripting object
    ... Prerequisite to running remote scripts. ... Remote WSH, which is a new technology included in WSH 5.6, provides the ... use Poledit.exe on the server. ...
    (microsoft.public.windows.server.scripting)
  • Re: Logon Scripts Acrossed VPN
    ... Scripts are one of those policies that don't process if a GP slow link is detected, so that may be what's happening for your remote sites. ... You can override this behavior by enabling the policy for those remote computers under Computer Configuration\Admin. ...
    (microsoft.public.windows.group_policy)
  • Batch and password access depending on hosts
    ... I am trying to add secure shell to a system where there are a lot of scripts ... to remote hosts - these are called from applications and cron jobs which use ... Fortunately the rsh-ing is just between a small number of "core" machines. ... But running two sets of sshd daemons seems a bit messy. ...
    (comp.security.ssh)