Anyone heard of 4D? Probably not, but I would love to work with
SQLAlchemy and this database.

How hard is it to write a new dialect?

Anyone had luck using generic odbc (ie not mysql moduled to pyodbc) to
connect to various "unsupported" databases?

I've tried a couple connection strings, the biggest problem is 4D
doesn't have a "database" name.

# connect to the actual database
from sqlalchemy import create_engine
#using DSN
engine = create_engine('mysql+pyodbc://4D_v11_Dev/DEFAULT_SCHEMA')
#using URL
engine = create_engine('mysql://user:p...@127.0.0.1', module='pyodbc')
#another dialect with DSN => ERROR: AttributeError: 'str' object has
no attribute 'paramstyle'
engine = create_engine('mssql://4D_v11_Dev', module='pyodbc')
# yet another try
engine = create_engine('mysql+pyodbc://4D_v11_Dev')
# show me output
engine.echo = True

None of those work, I have some stack traces, but the gist is this:
# when used without a database name
sqlalchemy.exc.DBAPIError: (Error) ('08004', '[08004] Server rejected
the connection:\nFailed to parse statement.\r (1301)
(SQLExecDirectW)') 'SELECT DATABASE()' ()

# when I try to specify a name
sqlalchemy.exc.DBAPIError: (Error) ('00000', '[00000] [iODBC][Driver
Manager]dlopen({MySQL}, 6): image not found (0) (SQLDriverConnectW)')
None None

But connection directly via pyodbc does work
import pyodbc
cnxn = pyodbc.connect("DSN=4D_v11_Dev;UID=user;PWD=pass")
cursor = cnxn.cursor()
cursor.execute('select * from ODBCTest')
a=cursor.fetchall()
print 'pyodbc',a

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

Reply via email to