1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] How to use dsn.ini file for odbc connection?

Discussão em 'Outras Linguagens' iniciado por Stack, Novembro 5, 2024 às 10:22.

  1. Stack

    Stack Membro Participativo

    I am trying to connect to the msserver using odbc connection using ipython-sql magic in jupyter notebook.

    I was wondering how to use dsn.ini file to load the configuration and connect to the server.

    References:

    My dsn.ini file


    [DB_Practice]
    username=sa
    password=myrealpassword
    host=myoriginalservername
    drivername=ODBC Driver 17 for SQL Server
    database=Practice

    Error


    %load_ext sql
    %config SqlMagic.dsn_filename='./dsn.ini'
    %sql --section DB_Practice


    Environment variable $DATABASE_URL not set, and no connect string given.
    Connection info needed in SQLAlchemy format, example:
    postgresql://username:password@hostname/dbname
    or an existing connection: dict_keys([])

    Question


    How to connect to msserver using odbc and using dsn.ini file?

    Continue reading...

Compartilhe esta Página