Think about Loose Coupling | |
PerlMonks |
Win32/DBD::ODBC: works from cmd.exe, not works from apache (xampp)by alexander_lunev (Pilgrim) |
on Nov 28, 2016 at 06:14 UTC ( [id://1176681]=perlquestion: print w/replies, xml ) | Need Help?? |
alexander_lunev has asked for the wisdom of the Perl Monks concerning the following question: Hello, monks! I'm not sure it it's a Perl issue, but it is somehow related to it, so i'll give it a try. I have a Windows 2003 server, and an old database in DBF files, and a need to work with this DB. Numerous scripts are works fine when started from command line, doesn't matter through Win32::ODBC or DBI::ODBC, but when they started from local apache web server (XAMPP, running under the same user), the shows me an error: ERROR ODBC: [-1022] [] "[Microsoft][ODBC dBase Driver] Disk or network error."or, if i use DBD::ODBC: ERROR ODBC: [Microsoft][ODBC dBase Driver] Disk or network error. (SQL-HY000)But when i run the same script from command line, everything works fine:
the code itself:
Although i can have access to *.dbf files and DSN list of ODBC driver from apache. The code:
gives me the output:
What's the problem here? UPDATE: SOLVED thanks to Corion. Seems that for ODBC to work it needs TMP environment variable. Setting it in code before ODBC stuff did the trick. $ENV{'TMP'} = 'C:\\DOCUME~1\\lan\\LOCALS~1\\Temp\\2';
Back to
Seekers of Perl Wisdom
|
|