Can't use DB name with dashes using pymssql ???

Samuel Morhaim samuel.morhaim at gmail.com
Wed Aug 13 18:30:40 EDT 2008


I believe there is a bug in Python.. _mssql ...    I am not too familiar
with Python yet, but after adding several breakpoints and watching the
variable, the last step of pymssql.py is

    # open the connection
    con = _mssql.connect(dbhost, dbuser, dbpasswd)

    con.select_db(dbbase)


At this point the contents of dbbase is "Gcare4UI-B6_3_dev" (no quotes)...
however, the immediate error is that
"Gcare4UI" does not exist.

Again removing the DASH from Gcare4UI-B6_3_dev and turning it into
Gcare4UIB6_3_dev results in error that can't find DB Gcare4UIB6_3_dev (of
course because the DB without the - doesnt exist... )

please help... thanks.


On Wed, Aug 13, 2008 at 4:54 PM, Samuel Morhaim <samuel.morhaim at gmail.com>wrote:

> I tried:
>
> import sys
> import pymssql
>
> db = 'Gcare4UI-B6_3_dev'
>
> conn = pymssql.connect (host = "localhost",
>                          user = "myname",
>                          password = "mypassword",
>                          database = db)
>
>
>
> And this returns an error saying
> Could not locate entry in sysdatabases for database 'Gcare4UI'. No entry
> found with that name.
>
> It is not reading the db name after the Dash... if i remove the dash from
> the db to see what happens, it shows this obvious error, because it  doesnt
> exist... i was just making  sure the problem was with the dash
>
> Could not locate entry in sysdatabases for database 'Gcare4UIB6_3_dev'. No
> entry found with that name.
>
> Anyone had this problem?
>
> Thanks.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080813/603688fa/attachment-0001.html>


More information about the Python-list mailing list