Problems scheduling a python program using the ODBC module with WinAT

Tom Funk _spam_sux_tdfunk at _spam_sux_nettally.com
Thu Mar 23 22:18:08 CET 2000


In an article posted Thu, 23 Mar 2000 13:12:16 +0100,
=?iso-8859-1?Q?Andr=E9?= Larsen Risnes (andrer at stud.cs.uit.no) said:
> Hi. I have a small progam that contatcs an ODBC data source, like this:
> 
> 
> import dbi, odbc
> 
> ...
> 
> dbc = odbc.odbc('theDSN/theUID/thePASSWORD')
> 
> ...
> 
> 
> The program is started from a .bat file. The problem: When i start the
> .bat
> file from the command line it works fine, but when the WinAT scheduler
> starts the .bat file, the program can't contact the ODBC data source. 
> Any suggestions to why this might be so would be much appreciated.
> 
> --
> André Larsen Risnes
> 
Is your DSN a user DSN or a system DSN?  NT mediates access to DSNs based 
on user login.  System DSNs are available to all contexts, however, User 
DSN are only available to the user who creates the DSN.  Try changing 
your DSN to a System DSN.  When WinAT runs, it doesn't run as the user 
who creates the scheduling entry. Here's a comment from the WinAT help 
file that talks about security:

    Caution: AT jobs will NOT run under the security context 
    of the user requesting it. Rather, they will run in whatever 
    context the Schedule service is running, typically the 
    operating system's context.

So, when you run the batch file, its running under the system context.  
Your user DSNs won't be available.

Barring this, try logging the ODBC session to a file.  Look at the 
Tracing tab in the ODBC Data Source Administrator window.  Turn on 
tracing and try it again.  The result could be instructive.

-- 
-=< tom >=-
Thomas D. Funk (tdfunk at asd-web.com)      |        "Software is the lever
Software Engineering Consultant          | Archimedes was searching for"
Advanced Systems Design, Tallahassee FL. |




More information about the Python-list mailing list