MS SQL Server: NT Authentication. Possible?

Dirk Hagemann DirkHagemann at gmail.com
Wed Aug 23 11:48:47 EDT 2006


I already mentioned, that it the following works when it's NOT executed
by the webserver:
> <code>
> import adodbapi

> db = adodbapi.connect ("Provider=sqloledb;Data Source=VODEV1;Initial
> Catalog=EVOBACK;Integrated Security=SSPI;")
> q = db.cursor ()
> q.execute ("SELECT SYSTEM_USER")
> print q.fetchone ()
> q.close ()
> </code>

Now I found this work-around: I have on a fileserver some directories
with restricted rights. In every directory is a file which has always
the same name. Now I let the script (executed by the IIS-Webserver) try
to open this file (directory is chosen by the user):
data =
open("\\\\server\\directory\\"+variable+"\\index.py","r").readlines()
If the NT-Account of the user has the right to open this file, the
script will proceed with the addicted Database-View. If the user has
not the right he gets an error-message.

And this works! In this case the webserver is working on the fileserver
with the NT-account of the user who has used the webinterface. So on
the one hand the IIS works fine with the fileserver, but the IIS does
not work with the SQL-Server. And it seems not to be the fault of the
code, because it works when it's executed directly.
It's so confusing...

Dirk




More information about the Python-list mailing list