Ricardo Aráoz wrote:
> Hi, this is my installation :
>
> Platform: Win
> Python Version: 2.5.2 on win32
> Dabo Version: Version 0.9.1; Revision ~5017
> UI Version: 2.8.8.1 on wxMSW
>
> Yesterday I downloaded and installed "pymssql-1.0.1.win32-py2.5.exe",
> tried it in Dabo and did not work. So I went back just by running
> "pymssql-0.8.0.win32-py2.5.exe" on top of the previous installation. And
> I copied your "pymssql.py" into site-packages replacing the original.
> Then I test it :
> ---------------------------------------------------------------------------------------------------------------------
>   
>>>> import pymssql
>>>> pymssql.__version__
>>>>         
> '0.8.0'
>   
>>>> conn = pymssql.connect(user='someuser', password='somepasswd',
>>>>         
> host='somehost', database='somedb')
>   
>>>> cursor = conn.cursor()
>>>> cursor.execute('select TablasVSID, Nombre from TablasVs (NOLOCK)')
>>>> cursor.rowcount
>>>>         
> 7
>   
>>>> class reg(object):
>>>>         
> ...     def __init__(self, cursor, registro):
> ...         for (attr, val) in zip((d[0] for d in cursor.description),
> registro) :
> ...             setattr(self, attr, val)
> ...    
>   
>>>> for row in cursor.fetchall() :
>>>>         
> ...     r = reg(cursor, row)
> ...     print r.TablasVSID, r.Nombre
> ...    
> 1 ABCodOp
> 2 ABMovStock
> 3 ABAlmacen
> 4 ABGrupo
> 5 ABTipo
> 6 ABUnidad
> 7 ABArticulo
>   
> ---------------------------------------------------------------------------------------------------------------------
>
> So everything seems Ok.
> Now to dabo, generate a connection, it tests ok  :
> ---------------------------------------------------------------------------------------------------------------------
> <?xml version="1.0" encoding="utf-8" standalone="yes"?>
> <connectiondefs xmlns="http://www.dabodev.com";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://www.dabodev.com conn.xsd"
> xsi:noNamespaceSchemaLocation = "http://dabodev.com/schema/conn.xsd";>
>
>     <connection dbtype="MsSQL">
>         <name>SomeName</name>
>         <host>SomeHost</host>
>         <database>SomeDB</database>
>         <user>SomeUser</user>
>         <password>E1123423134512347R89</password>
>         <port>1433</port>
>     </connection>
>
>
> </connectiondefs>
> ---------------------------------------------------------------------------------------------------------------------
> Open the Class Designer, on the dPanel rightClick->Add Controls from
> Data Environment, and in comes the wizard.
> Click on "Open a connection file", look for my connection, select it,
> then click on "Next" and it does nothing, the window is still responding
> as if the button had no code. If I select "sample" and click Next the
> wizard informs me that it cannot connect to Sample, but with my
> sqlserver connection nothing happens. Even if I create a new connection
> on the spot and test ok then the Next button will do nothing.
> Any ideas on how could I trace what's going on?
>
>
>
>   
Ok, now at work, everything is actualized, current system :

Platform: Win
Python Version: 2.5.2 on win32
Dabo Version: Version 0.9.1; Revision ~5048
UI Version: 2.8.8.1 on wxMSW

Start Class designer, go to "LayoutPanel (dPanel)", right click and
choose "Add Controls from Data Environment", in comes the wizard, <Open
a Connection File>, choose my connexion (see above)  and this is the
error message :
---------------------------------------------------------------------------------------------------------------------------------
Microsoft Windows XP [Versión 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Python25\Lib\site-packages\dabo\IDE>python ClassDesigner.py
Traceback (most recent call last):
  File "C:\Documents and Settings\raraoz\dabo\ui\uiwx\dControlMixin.py",
line 27
, in _onWxHit
  File "C:\Python25\lib\site-packages\dabo\ui\uiwx\dPemMixin.py", line
944, in r
aiseEvent
    super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,
**kwargs)
  File "C:\Python25\lib\site-packages\dabo\lib\eventMixin.py", line 93,
in raise
Event
    bindingFunction(event)
  File "C:\Documents and Settings\raraoz\dabo\ui\dialogs\Wizard.py",
line 124, i
n onNext
  File "C:\Documents and Settings\raraoz\dabo\ui\dialogs\Wizard.py",
line 291, i
n _setCurrPage
  File
"C:\Python25\Lib\site-packages\dabo\IDE\wizards\QuickLayoutWizard.py", li
ne 63, in onLeavePage
    return self.Wizard.makeConnection()
  File
"C:\Python25\Lib\site-packages\dabo\IDE\wizards\QuickLayoutWizard.py", li
ne 788, in makeConnection
    tbls = crs.getTables()
  File "C:\Python25\lib\site-packages\dabo\db\dCursorMixin.py", line
1947, in ge
tTables
    return self.BackendObject.getTables(self.AuxCursor, includeSystemTables)
  File "C:\Python25\lib\site-packages\dabo\db\dbMsSQL.py", line 79, in
getTables

    {'db':dbName} )
  File "C:\Python25\lib\site-packages\dabo\db\dCursorMixin.py", line
330, in exe
cute
    raise dException.DBQueryException(errMsg, sql)
dabo.dException.DBQueryException: internal error: None
SQL: select table_name from INFORMATION_SCHEMA.TABLES where
table_catalog = %(db
)s and table_type = 'BASE TABLE' order by table_name
---------------------------------------------------------------------------------------------------------------------------------

If I go to the connection editor and open this connection and test it,
it tells me the connection was successful.
Went into SQLServer and this select works ok :
"""select table_name from INFORMATION_SCHEMA.TABLES
        where table_type = 'BASE TABLE'
        order by table_name""" .
If I perform
"""select table_name, table_catalog  from INFORMATION_SCHEMA.TABLES
    where table_type = 'BASE TABLE'
    order by table_name"""
 I can see table_catalog == 'master' for all lines, and none of the
table_name's are my tables.
Maybe what you want to do is
"""select table_name from %(db)sINFORMATION_SCHEMA.TABLES
    where table_catalog = %(db)s
            and table_type = 'BASE TABLE'
    order by table_name"""
or even :
"""select table_name from %(db)sINFORMATION_SCHEMA.TABLES
    where table_type = 'BASE TABLE'
    order by table_name"""
Which would work in my system (if variable db=='SomeDB' (see cited post
above for what 'SomeDB' stands for)).

Ricardo








--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to