That sounds like the cgi script is run by a different user than the shell script

If you use the ODBC Manager, try to use a SystemDSN instead of a userDSN, then all users should be able to access it. Or use perl to create the UserDSN for that user:

#! perl use strict; use Win32::ODBC; my $dsn = "mydsn"; # name of the DSN in ODBC manager my $dsnDescription = "testdsn"; my $sqlServer = "mymachine"; # Hostname of the SQL-Server my $database = "mydb"; # Name of Database my $uid = ""; # userId my $password = ""; # password if (Win32::ODBC::ConfigDSN ( ODBC_ADD_DSN, "SQL Server", # or name of ODBC ( "DSN=$dsn", "DESCRIPTION=$dsnDescription", "SERVER=$sqlServer", "DATABASE=$database", "UID=$uid", "PWD=$password", ) ) ){ print ("DSN $dsn sucessfully created\n"); } else { die ("ERROR: couldn't create DSN '$dsn': ".Win32::ODBC::Error()); }
If you need special values you don't know, create the DSN with the ODBC manager and then have a look at your registry: * System-DSN: HKEY_LOCAL_MACHINE\Software\ODBC * User-DSN: HKEY_CURRENT_USER\Software\ODBC there you will find your DSNs with its properties, e.g.
"DATABASE=$database", "UID=$uid", "PWD=$password", "Trusted_Connection=Yes",

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"


In reply to Re: Logging onto other Domain PC from CGI Shell by strat
in thread Logging onto other Domain PC from CGI Shell by roscomputing

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.