title: Dependencies for VB6 connection to Oracle DB
body: <p>I have an old VB6 app which uses ADO to connect to SQL server databases, as:</p>
  
  <pre><code>Dim cnServer As New ADODB.Connection
  cnServer.Provider = "sqloledb"
  sConnectString = "Server=" &amp; txtServer.Text &amp; ";" &amp; _
                   "Database=" &amp; txtDatabase.Text &amp; ";" &amp; _
                   "User ID=" &amp; txtUserID.Text &amp; ";" &amp; _
                   "Password=" &amp; txtPassword.Text &amp; ";" &amp; _
                   "Connect timeout=10"
  cnServer.Open sConnectString
  </code></pre>
  
  <p>...which has always worked.  But now I need to modify it to connect to an Oracle 11g database.  I found <a href="http://www.vb6.us/tutorials/oracle-and-visual-basic-using-ado" rel="nofollow">this article</a> and modified the code to:</p>
  
  <pre><code>Dim cnServer As New ADODB.Connection
  cnVLServer.Provider = "OraOLEDB.Oracle"
  sConnectString = "Server=" &amp; txtServer.Text &amp; ";" &amp; _
                   "Data Source=" &amp; txtDatabase.Text &amp; ";" &amp; _
                   "User ID=" &amp; txtUserID.Text &amp; ";" &amp; _
                   "Password=" &amp; txtPassword.Text &amp; ";" &amp; _
                   "Connect timeout=10"
  cnVLServer.Open sConnectString
  </code></pre>
  
  <p>...but when I run it, I get an error that reads <code>3706, Provider cannot be found. It may not be properly installed.</code>  This happens on my development VM (which -- don't laugh -- is still on Win2K Pro), and also on my test machine (which uses Win XP).</p>
  
  <p>Some further searching indicated that oracore11.dll is a dependency, so I went to Oracle's download site and pulled down this DLL as part of a .zip file containing what I take to be the full suite of Windows-related coding tools.  However the error still occurs even if I place this DLL in the same folder with my VB6 executable.  And when I try to register the DLL, the attempt just generates another error:  <code>The specified module could not be found.</code></p>
  
  <p>Before any further thrashing with what may be a wrong path or an unsolvable problem in the first place, I figured I should check in and see the best/easiest way to get a VB6 app to connect to Oracle in the first place.  My goal here is to have this VB6 app be as portable as possible, not requiring any pre-installed packages to work, and having the minimum set of dependencies be easily passed around with the .exe itself.  (For reference, this VB6 app is not a commercially-distributed product, just an internally-used testing tool within my own department at work.  It takes flat-file fixed width data, parses it, then generates the SQL code to insert it to the DB.)</p>