19 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: SQLAlch. + ODBC + DB...| From | Sent On | Attachments |
|---|---|---|
| durumdara | 26 Apr 2007 02:35 | |
| Michael Bayer | 26 Apr 2007 05:49 | |
| Durumdara | 26 Apr 2007 06:35 | |
| Michael Bayer | 26 Apr 2007 08:14 | |
| Rick Morrison | 26 Apr 2007 08:32 | |
| Paul Johnston | 26 Apr 2007 09:51 | |
| Rick Morrison | 26 Apr 2007 14:53 | |
| Michael Bayer | 26 Apr 2007 14:58 | |
| Rick Morrison | 26 Apr 2007 15:14 | |
| Michael Bayer | 26 Apr 2007 15:28 | |
| Rick Morrison | 26 Apr 2007 15:31 | |
| Durumdara | 26 Apr 2007 23:48 | |
| Rick Morrison | 27 Apr 2007 07:07 | |
| Michael Bayer | 27 Apr 2007 09:23 | |
| Rick Morrison | 27 Apr 2007 09:40 | |
| Paul Johnston | 01 May 2007 12:42 | |
| Rick Morrison | 01 May 2007 13:16 | |
| Michael Bayer | 01 May 2007 13:36 | |
| Rick Morrison | 01 May 2007 15:20 |
| Subject: | [sqlalchemy] Re: SQLAlch. + ODBC + DBISAM... :-(![]() |
|---|---|
| From: | Michael Bayer (mike...@zzzcomputing.com) |
| Date: | 04/26/2007 08:14:20 AM |
| List: | com.googlegroups.sqlalchemy |
On Apr 26, 2007, at 9:35 AM, Durumdara wrote:
Hi!
2007/4/26, Michael Bayer <mike...@zzzcomputing.com>:
mssql:// supports pyodbc.
And how to I open the engine? (XXX is the name of the ODBC DataSource what I want to open. It is DBISAM database).
from sqlalchemy import * import pyodbc db = create_engine('mssql://zeusweb', module=pyodbc)
The result is:
use the trunk first of all since MS-SQL support is largely experimental, the "import" is already included in there so it should use pyodbc automatically (you can add the argument 'module_name="pyodbc"` to create_engine() to force it), and I dont know anything about pyodbc so the function that breaks the URL into odbc, given a URL of the form:
mssql://user:password@host/database
is:
def make_connect_string(self, keys): connectors = ["Driver={SQL Server}"] connectors.append("Server=%s" % keys.get("host")) connectors.append("Database=%s" % keys.get("database")) user = keys.get("user") if user: connectors.append("UID=%s" % user) connectors.append("PWD=%s" % keys.get("password", "")) else: connectors.append ("TrustedConnection=Yes")
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqla...@googlegroups.com
To unsubscribe from this group, send email to
sqla...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---




