title: vb6 can't open a connection obj that used to work perfectly
body: <p>This code is in an ActiveX .dll. For a year this connection worked perfectly, now it doesn't. Here's the code:</p>
  
  <pre><code>Dim objConnection As ADODB.Connection
  Dim objRs As ADODB.Recordset
  Dim theConnectionStr As String
  
  Dim SanMarDB As Databas
  Dim SanMarRs As Recordse
  .
  .
  .
      Set objConnection = New ADODB.Connection
      theConnectionStr = "Provider=Microsoft.Jet.OLEDB.4.0;" &amp; _
                         "Data Source=" &amp; gProgramFilesPath &amp; ";" &amp; _
                         "Extended Properties='text;HDR=YES;FMT=Delimited;IMEX=1'"
      objConnection.Open theConnectionStr
  </code></pre>
  
  <p>Here is my list of references in the .dll:</p>
  
  <ul>
  <li>Visual Basic for Applications</li>
  <li>Visual Basic runtime objects and procedures</li>
  <li>Visual Basic objects and procedures</li>
  <li>Microsoft Scripting Runtime</li>
  <li>Microsoft Excel 14.0 Object Library</li>
  <li>Microsoft DAO 3.6 Object Library</li>
  <li>Microsoft ActiveX Data Objects 6.1 Library</li>
  <li>Microsoft Data Formatting Object Library 6.0 (SP6)</li>
  <li>Microsoft Shell Controls and Automation</li>
  </ul>
  
  <p>I get one of two error messages. Here's the first</p>
  
  <blockquote>
    <p>Invalid setting in Excel key of the Engines section of the Windows Registry.</p>
  </blockquote>
  
  <p>Google pointed me to some reasons for this error message and I've checked the registry setting and it appears correct, CSVDelimited, no 5-char entries, etc.</p>
  
  <p>The second error message is:</p>
  
  <blockquote>
    <p>Object variable or With block variable not set</p>
  </blockquote>
  
  <p>The thing that makes this particularly strange is that I have another dll that has exactly the same references and code and it works perfectly. (only some filenames are different).</p>
  
  <p>Any thoughts? Thanks for helping me out with this.</p>
  
  <p>-t</p>