Hi guys. Thanks for all the help on my previous topic (MS Access
querying).

I have another new-userish question about mssql. I wrote some working
code the other day(meaning connection was set up correctly I hope?),
and it doesn't work anymore today. I tried retracing my steps, but I
can't seem to find out what I did to break it.

I know having people debug for you is really frowned upon (I hate
doing it myself), but I've slowly taken code out of my program until
there's almost nothing left but whats necessary to recreate the
problem. Whats even worse about it is that SA gives NO error messages.
I've reduced the initial point of the problem here:

from sqlalchemy import *

class MasterList:
    def __init__(self):
        self.dbInit("sa", "pass-word", "127.0.0.1")
        self.initTables()

    def dbInit(self, user, passwd, location):
        connectionString = 'mssql://%s:[EMAIL PROTECTED]:1433/ServerMonitor'%
(user, passwd, location)
        self.engine = create_engine(connectionString)
        self.meta = MetaData(self.engine)

    def initTables(self):
        self.Services =         Table( 'Services', self.meta,
                                Column('ID', Integer,
primary_key=True),
                                Column('Name', String(255)),
                                )
        self.meta.create_all(self.engine)

ml = MasterList()
print "the end"


What happens is that it never gets past the create_all statement (no
the end printed when code executed). No error statements are created.

I do admit that I am using the newest version of SA(4+), which is said
to have problems with MSSQL, but I don't think you meant it to be this
bad :) Again, any help would be appreciated.

In the mean time would it be safe to change the connection string to
an sqlite db and then switch back to ms-sql once it starts working
again right? The syntax in SA should be the same for everything
besides the connection string when dealing with table creation, simple
insertion and "simple" querying?

Also I have tried using pyodbc to the best of my knowledge (which
doesn't go very far in SA)... all i did was add module=pyodbc to the
engine string as a parameter and imported it at top. Didn't change the
result.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to