Connecting to SQL database

kyosohma at gmail.com kyosohma at gmail.com
Thu Dec 20 16:11:59 EST 2007


On Dec 14, 8:24 pm, bill ramsay <blah at blahdeblah> wrote:
> Hi
>
> I have successfully connected to SQL2000 and MSDEE databases in the
> past,  however I have to move to SQL2005 and SQLEXPRESS databases now.
>
> I've tried the following but with no luck [this is what i used in the
> earlier incarnation except the Provider resource was SQLOLEDB.1]
>
>     Conn = Dispatch('ADODB.Connection')
>     Conn.ConnectionString = "Provider=SQLNCLI;Server=10.1.1.2;
> Database=csrctest;Uid=bill;Pwd=bill"
>     print Conn.ConnectionString
>
>     try:
>         print 'trying to open'
>         Conn.Open()
>
>         etc.
>
> All I ever get to is the trying to openline,  then it times out.
>
> I have tried all of the following combinations too:
>
> Provider=SQLNCLI;Server=localhost;Database=csrctest;Uid=bill;Pwd=bill;
>
> Provider=SQLNCLI;Server=localhost\SQLEXPRESS;Database=csrctest;Uid=bill;Pwd=bill;
>
> The SQLEXPRESS database for testing purposes is on my home PC
> [10.1.1.2]
>
> Any clues s to where I am going wrong?
>
> Look forward to hearing from someone,  anyone!!
>
> Kind regards
>
> Bill

What Python module are you using? At first I thought you were using
the adodb module for Python, but your syntax doesn't look right for
that one.

Mike



More information about the Python-list mailing list