title: Python/PyODBC Connect to SQL Server 2008 DB by IP with Trusted Connection
body: <p>If this has been asked, I apologize in advance, I couldn't find the right answer, although I've found similar questions.</p>
  
  <p>I'm trying to connect to a SQL Server 2008 DB by using it's IP / Port using trusted connection.</p>
  
  <p>One additional point of complexity is: The database is outside of the US and usually we log in via Citrix.  After logging into citrix, it uses our windows credentials (not sure if that impacts the issue).</p>
  
  <p>I have tried several different types of connection strings</p>
  
  <p>Driver=SQL Server <br>
  Driver=SQL Native Client<br>
  Driver=SQL Server Native Client 10.0<br></p>
  
  <p>I've also tried differen't formats of including the port, as well as messing with the Network Library when using the IP route. </p>
  
  <p>I was hoping someone could help me understand 2 things.</p>
  
  <p>1) (Most importantly) How do I figure out how to properly connect without simple trial and error.  I tried checking connectionstrings.com but that didn't really help all that much.  I haven't been able to find anything online.</p>
  
  <p>2) If someone can help me out with connection string.</p>
  
  <p>Here's an example of what I'm doing:</p>
  
  <pre><code>cn = pyodbc.connect(r'DRIVER={SQL Native Client};Server=1.1.3.4,1234;Network    Library=DBMSSOCN;Initial Catalog=Test;UID=DOM\me;Pwd=pass')
  </code></pre>
  
  <p>Any help/guidance is much appreciated.</p>