ADO/ODBC call via Python/IIS

Bill Seitz fluxent at yahoo.com
Fri Feb 9 16:52:51 EST 2001


Well, my simpler DSN-less code seems to be doing the right thing. But
get that lovely "Not associated with a trusted SQL Server connection."
error message. I've tried with and without a domain prefix on the uid.

Could this be related to running SQL in "active directory only" mode?

In article <lku38t0dl2jb5210e7ler5kv3c7qcfiadk at 4ax.com>,
  David Fuess <fuess at att.net> wrote:
>
> Here is the beginning of my SQL Server class:
>
> class Database:
>    def __init__(self,Name,Server="Default",Arg=""):
>       self.adoConn = None
>       self.adoRS = None
>       self.RecordCount = 0
>       self.eof = 1
>       self.ConnectString = "database=%s;driver={SQL
> Server};QueryTimeout=300;server=%s;uid=sa%s"%(Name,Server,Arg)
>       self.Schema = {}
>       if AutoOpenOnInit:
>          self.Open(Name)
>
>    def Open(self,Name):
>       if self.adoConn is not None:
>          self.Close()
>       self.adoConn = win32com.client.Dispatch('ADODB.Connection')
>       self.adoConn.CursorLocation = 3
>       self.adoConn.CommandTimeout = 900
>       self.adoConn.Open(self.ConnectString)
>       if AutoloadSchema:
>          self.LoadSchema()
>
> And so on ...
>
> I use it regularly to connect to SQL Server Databases. It is DSNless
> in that it attaches directly to SQL Server without any specific DSN
> assignments. It has nothing to do with IIS, only ADO.
>
> Dave
> On Wed, 7 Feb 2001 17:57:47 -0600, "dsavitsk" <dsavitsk at e-coli.net>
> wrote:
>
> >maybe not the error here, but you need a ";" at the end of the
string ...
> >see below.
> >
> >> adoConn.Open('driver=SQL
> >> Server;server=sql0;uid=xxx;pwd=yyy;database=zzz;')
> >
> >
>
>


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list