title: Connecting to a Database using VBA
body: <p>I know its a basic question but no one has asked it so i am asking probably everyone knows it.</p>
  
  <pre><code>Dim cnn As ADODB.Connection.
  Dim rst As ADODB.Recordset
  Set cnn = New ADODB.Connection
  With cnn
      .ConnectionString = "Driver=SQL Server;Server=something;Uid=something;PWD=something!;Database=CS"
      .ConnectionTimeout = 60
      .Open
  End With
  </code></pre>
  
  <p>Ok so here i have a doubt where do we define the actual existence of the database?</p>
  
  <p>i mean how will the code know where is the DB? we need to give some path reference right?</p>
  
  <p>The above code opens the connection and keeps it ready but where is the DB how does the code know?</p>