This project has moved. For the latest updates, please go here.

How do I access a database from my Python code?

Jun 4, 2014 at 4:34 PM
I have connected an existing database by going to Tools -> Connect to a Database.... I can now see my database in server explorer.

What should I call from my Python code to use that database? I installed pyodbc but am unsure as to what information I can use to access it.
Jun 4, 2014 at 7:23 PM
We don't have any Server Explorer integration in PTVS yet, so there's nothing similar to the ability to drag and drop the connection into your project or source file and have auto-generated connection strings and code, like .NET does.

The exact steps for connecting to a database would depend on what kind of database that is - can you share more details about it? PyODBC might not even be the best choice for that.
Jun 4, 2014 at 7:45 PM
Edited Jun 4, 2014 at 8:13 PM
This is a MSSQL server. So Transact SQL I think is the answer to your question.