I have installed CData ODBC driver for Salesforce and able to connect Salesforce through username, password and security token. I wanted to access through OAuth as well. I have followed all the steps mentioned in the link below. How can we go further.
http://cdn.cdata.com/help/RFE/odbc/pg_oauth.htm
Here is my code to connect Salesforce through username, password and Security Token and able to save the data in a csv file. How to do the same through OAuth?
import pyodbc
import csv
cnxn = pyodbc.connect("DRIVER={CData ODBC Driver for Salesforce};User=yourusername;Password=password;Security Token=security token;")
cursor = cnxn.cursor()
query = "SELECT * from AccountPartner"
cursor.execute(query)
csvfile=open('persons.csv','w', newline='')
obj=csv.writer(csvfile)
for row in cursor:
print(row)
obj.writerow(row)
csvfile.close()