Re: pymssql connection problem

VV W <[email protected]> Fri, 11 Sep 2009 09:31:38 -0700
Newsgroups gmane.comp.python.sybase
Message-ID <[email protected]>
--===============8986466234490066930==
Content-Type: multipart/alternative; boundary=000e0cd488cea9cbb004734fd9d0

--000e0cd488cea9cbb004734fd9d0
Content-Type: text/plain; charset=ISO-8859-1

Thanks Lloyd for your reply.

dsn is "None" by default so we can omit it without any problems. For "host",
if I use
host = "somehost.COM",
then my code gets the same error as I posted last time. Now I use
host="12.12.12.12:5000",  (5000 is a port number), then I get


File "/var/lib/python-support/python2.5/pymssql.py", line 328, in connect
    con = _mssql.connect(dbhost, dbuser, dbpasswd)
_mssql.error: Could not set connection properties

Did you install a python/sybase library module specially?



On Fri, Sep 11, 2009 at 5:39 AM, Lloyd Kvam <[email protected]> wrote:

> On Thu, 2009-09-10 at 13:21 -0700, VV W wrote:
> > Hello,
> >
> > I modified my script and tested again with
> >
> >  con=pymssql.connect(dsn='sybase-sever.mycompany.com', user='sa',
> > password='',host="12.12.12.12",database='db-name')
>
>        self.conn = pymssql.connect(
>            host = "somehost.COM",
>            user='someuser',
>            password='somepassword',
>            database='somedb',
>            )
>
> Works for me.  I don't know how to use the dsn parameter.  Does that
> depend on ODBC configuration?
>
> >
> > and now I got
> >
> >
> >  File "/var/lib/python-support/python2.5/pymssql.py", line 328, in
> > connect
> >     con = _mssql.connect(dbhost, dbuser, dbpasswd)
> > _mssql.error: DB-Lib error message 20009, severity 9:
> > Unable to connect: Adaptive Server is unavailable or does not exist
> > Net-Lib error during Operation now in progress
> > Error 115 - Operation now in progress
> >
> >
> > this is the problem that I got yesterday. It's really frustrating.
> >
> > Anybody can give me a clue?
> >
> > Thanks so much.
> >
> ------------------------------------------------------------------------------
> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> > trial. Simplify your report design, integration and deployment - and
> focus on
> > what you do best, core application coding. Discover what's new with
> > Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> > _______________________________________________ Python-sybase-misc
> mailing list [email protected]
> https://lists.sourceforge.net/lists/listinfo/python-sybase-misc
> --
> Lloyd Kvam
> Venix Corp
> DLSLUG/GNHLUG library
> http://dlslug.org/library.html
> http://www.librarything.com/catalog/dlslug
> http://www.librarything.com/rsshtml/recent/dlslug
> http://www.librarything.com/rss/recent/dlslug
>
>

--000e0cd488cea9cbb004734fd9d0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Thanks Lloyd for your reply. </div>
<div>=A0</div>
<div>dsn is &quot;None&quot; by default so we can omit it without any probl=
ems. For &quot;host&quot;, if I use<br>host =3D &quot;somehost.COM&quot;,<b=
r></div>
<div>then my code gets the same error as I posted last time. Now I use</div=
>
<div>host=3D&quot;<a href=3D"http://12.12.12.12:5000">12.12.12.12:5000</a>&=
quot;,=A0 (5000 is a port number), then I get</div>
<div>=A0</div>
<div>=A0</div>
<div>File &quot;/var/lib/python-support/python2.5/pymssql.py&quot;, line 32=
8, in connect<br>=A0=A0=A0 con =3D _mssql.connect(dbhost, dbuser, dbpasswd)=
<br>_mssql.error: Could not set connection properties<br></div>
<div>=A0</div>
<div>Did you install a python/sybase library module specially? </div>
<div>=A0</div>
<div><br>=A0</div>
<div class=3D"gmail_quote">On Fri, Sep 11, 2009 at 5:39 AM, Lloyd Kvam <spa=
n dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]">[email protected]</a>&=
gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0=
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class=3D"im">On Thu, 2009-09-10 at 13:21 -0700, VV W wrote:<br>&gt; He=
llo,<br>&gt;<br>&gt; I modified my script and tested again with<br>&gt;<br>=
&gt; =A0con=3Dpymssql.connect(dsn=3D&#39;<a href=3D"http://sybase-sever.myc=
ompany.com/" target=3D"_blank">sybase-sever.mycompany.com</a>&#39;, user=3D=
&#39;sa&#39;,<br>
&gt; password=3D&#39;&#39;,host=3D&quot;12.12.12.12&quot;,database=3D&#39;d=
b-name&#39;)<br><br></div>=A0 =A0 =A0 =A0self.conn =3D pymssql.connect(<br>=
=A0 =A0 =A0 =A0 =A0 =A0host =3D &quot;somehost.COM&quot;,<br>=A0 =A0 =A0 =
=A0 =A0 =A0user=3D&#39;someuser&#39;,<br>=A0 =A0 =A0 =A0 =A0 =A0password=3D=
&#39;somepassword&#39;,<br>
=A0 =A0 =A0 =A0 =A0 =A0database=3D&#39;somedb&#39;,<br>=A0 =A0 =A0 =A0 =A0 =
=A0)<br><br>Works for me. =A0I don&#39;t know how to use the dsn parameter.=
 =A0Does that<br>depend on ODBC configuration?<br>
<div class=3D"im"><br>&gt;<br>&gt; and now I got<br>&gt;<br>&gt;<br>&gt; =
=A0File &quot;/var/lib/python-support/python2.5/pymssql.py&quot;, line 328,=
 in<br>&gt; connect<br>&gt; =A0 =A0 con =3D _mssql.connect(dbhost, dbuser, =
dbpasswd)<br>
&gt; _mssql.error: DB-Lib error message 20009, severity 9:<br>&gt; Unable t=
o connect: Adaptive Server is unavailable or does not exist<br>&gt; Net-Lib=
 error during Operation now in progress<br>&gt; Error 115 - Operation now i=
n progress<br>
&gt;<br>&gt;<br>&gt; this is the problem that I got yesterday. It&#39;s rea=
lly frustrating.<br>&gt;<br>&gt; Anybody can give me a clue?<br>&gt;<br>&gt=
; Thanks so much.<br></div>&gt; -------------------------------------------=
-----------------------------------<br>
&gt; Let Crystal Reports handle the reporting - Free Crystal Reports 2008 3=
0-Day<br>&gt; trial. Simplify your report design, integration and deploymen=
t - and focus on<br>&gt; what you do best, core application coding. Discove=
r what&#39;s new with<br>
&gt; Crystal Reports now. =A0<a href=3D"http://p.sf.net/sfu/bobj-july" targ=
et=3D"_blank">http://p.sf.net/sfu/bobj-july</a><br>&gt; ___________________=
____________________________ Python-sybase-misc mailing list <a href=3D"mai=
lto:[email protected]">[email protected]=
ceforge.net</a> <a href=3D"https://lists.sourceforge.net/lists/listinfo/pyt=
hon-sybase-misc" target=3D"_blank">https://lists.sourceforge.net/lists/list=
info/python-sybase-misc</a><br>
<font color=3D"#888888">--<br>Lloyd Kvam<br>Venix Corp<br>DLSLUG/GNHLUG lib=
rary<br><a href=3D"http://dlslug.org/library.html" target=3D"_blank">http:/=
/dlslug.org/library.html</a><br><a href=3D"http://www.librarything.com/cata=
log/dlslug" target=3D"_blank">http://www.librarything.com/catalog/dlslug</a=
><br>
<a href=3D"http://www.librarything.com/rsshtml/recent/dlslug" target=3D"_bl=
ank">http://www.librarything.com/rsshtml/recent/dlslug</a><br><a href=3D"ht=
tp://www.librarything.com/rss/recent/dlslug" target=3D"_blank">http://www.l=
ibrarything.com/rss/recent/dlslug</a><br>
<br></font></blockquote></div><br>

--000e0cd488cea9cbb004734fd9d0--


--===============8986466234490066930==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
--===============8986466234490066930==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Python-sybase-misc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-sybase-misc

--===============8986466234490066930==--