title: Give Simba ODBC driver or bigrquery access to Google Drive files
body: <p>I am trying to load a BQ table that is based on a Google Spreadsheet into the statistics package Stata. I have tries two routes to accomplish this.</p>
  
  <p>First, I used the Simba ODBC driver for Mac (version 2.1.6), but I get the following error: </p>
  
  <pre><code>The ODBC driver reported the following diagnostics
  [Simba][BigQuery] (20) Query execution failed: Access Denied: BigQuery BigQuery: No OAuth token with Google Drive scope was found.
  SQLSTATE=HY000
  </code></pre>
  
  <p>In my odbc.ini file, I have set RequestGoogleDriveScope=1, and am using user authentication for OAuth Mechanism. I can query this table in BQ Web UI, and I can load other non-GS tables via ODBC.</p>
  
  <p>Second, I thought that maybe I can do this in R instead, bypassing Simba/ODBC:</p>
  
  <pre><code>library(bigrquery)
  data &lt;- query_exec("SELECT * FROM my_table;", project = "XXXX", useLegacySql = FALSE)
  Error: Access Denied: BigQuery BigQuery: No OAuth token with Google Drive scope was found.
  </code></pre>
  
  <hr>
  
  <p><strong>To summarize, this query works in BQ web UI, and does not work with R (using the API) or Stata (using ODBC). The common denominator is that neither Stata or R have google drive permissions in  <a href="https://myaccount.google.com/permissions" rel="nofollow noreferrer">https://myaccount.google.com/permissions</a>, whereas the BQ Client Tools has them.</strong> That is my best guess as to where the problem lies. Any suggestions on how to change the OAuth scope would be appreciated.</p>
  
  <p><strong>Cross-posted <a href="https://www.statalist.org/forums/forum/general-stata-discussion/general/1433222-allow-the-stata-driver-access-to-google-drive-files" rel="nofollow noreferrer">on Statalist</a>.</strong></p>