cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DineshGedda Frequent Visitor
Frequent Visitor

Python Scripts Error

Hi Everyone,

 

I was trying to connect to one of SQL server, where i couldn't reach out it through power Bi desktop. In my local IDE i could retrive data from same SQL source. In other way i retrived the data from power bi and up on again i tried python script but it seems again same error. Can some one hel me out why it's happening.

 

Script:

import pyodbc
conn = pyodbc.connect('Driver={SQL Server};'
'Server=server_name;'
'Database=db_name;'
'Trusted_Connection=yes;')

cursor = conn.cursor()
cursor.execute('SELECT * FROM db_name.Table')

 

 

Error:

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Python Scripts Error

Hi @DineshGedda ,

The file or directory is corrupted and unreadable I'm not so sure why you not use sql connector to get data, it also allow you to use t-sql query as additional parameter to sql database.

For your issue, I'd like to suggest you to check firewall settings and network policy to confirm if your request has been blocked.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
DineshGedda Frequent Visitor
Frequent Visitor

Re: Python Scripts Error

Hi @v-shex-msft , Thanks for your response, but it didn't worked.

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors