that's only a warning, it's not a failure.

We will look into the warning message, however if you e.connect(), it works 
fine.



On Fri, May 22, 2020, at 6:29 AM, Peter Lai wrote:
> example:
> 
> import pyodbc
> 
> from sqlalchemy import create_engine
> 
> def creator():
>  config = {
> 'driver': 'ODBC Driver 13 for SQL Server',
> 'host': 'localhost',
> 'port': 1433,
> 'user': 'me',
> 'pw': 'mypw',
> 'dbname': 'mydb'
> }
> 
> return pyodbc.connect(
> "DRIVER={{{driver}}};SERVER={host},{port};DATABASE={dbname};UID={user};PWD={pw}".format(
>  driver=config['driver'],
>  host=config['host'],
>  port=config.get('port',1433),
>  dbname=config['dbname'],
>  user=config['user'],
>  pw=config['pw']
> )
> )
> 
> # works
> odbc_conn = creator()
> 
> # fails
> e = create_engine('mssql://', creator=creator)
> 
> 
> 
> /usr/lib/python3.6/site-packages/sqlalchemy/connectors/pyodbc.py:79: 
> SAWarning: No driver name specified; this is expected by PyODBC when using 
> DSN-less connections
>  "No driver name specified; "
> 
> 
> This is on SqlAlchemy 1.3.17
> 
> 
> 

> --
>  SQLAlchemy - 
>  The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
>  To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
>  --- 
>  You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
>  To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
>  To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/d3691dac-431b-4ed1-8670-59b8b959f81f%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy/d3691dac-431b-4ed1-8670-59b8b959f81f%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/2b0c0bc4-86c2-4085-91ef-4eccc3e644dd%40www.fastmail.com.

Reply via email to