{"id":319,"date":"2010-01-19T13:20:28","date_gmt":"2010-01-19T13:20:28","guid":{"rendered":"http:\/\/dirk.forbiddendream.be\/?p=319"},"modified":"2016-01-07T10:50:18","modified_gmt":"2016-01-07T10:50:18","slug":"database-connections-on-64-bit-systems","status":"publish","type":"post","link":"https:\/\/dirk.schuermans.me\/?p=319","title":{"rendered":"Database connections on 64-bit systems"},"content":{"rendered":"<p>Hello everyone,<\/p>\n<p>If you&#8217;re running a x64 variant of Windows, you might bump into the following problem whilst developing programs that work with databases:<\/p>\n<p>You can&#8217;t seem to establish a connection to the database.<\/p>\n<p>This usually means that there aren&#8217; t 64-bit drivers available for the database engine you&#8217;re using (For example, MS Access)<\/p>\n<p>The solution for your problem is easy:<br \/>\n<!--more--><\/p>\n<ul>\n<li>If you are developing a .NET application in Visual Studio:\n<ul>\n<li>For Visual Basic projects, go to the <em>Compile<\/em> tab and press the <em>Advanced Compile Options<\/em> button.<br \/>\nIn the dialog change the <em><strong>Target CPU<\/strong><\/em> to <em><strong>x86<\/strong><\/em><\/li>\n<li>For Visual C# projects, go to the <em>Build<\/em> tab and change <strong><em>Platform Target<\/em><\/strong> to <strong><em>x86<\/em><\/strong><\/li>\n<\/ul>\n<\/li>\n<li>If you are developing a Java application and you&#8217;re using DSN:\n<ul>\n<li>Add a <strong><em>System DSN<\/em><\/strong> using the <strong><em>odbcad32.exe<\/em><\/strong> located in <strong><em>C:\\Windows\\SysWOW64\\odbcad32.exe<\/em><\/strong> and <strong><span style=\"text-decoration: underline;\">NOT<\/span><\/strong> the one located in <strong><em>C:\\Windows\\System32\\odbcad32.exe<\/em><\/strong> (The one that opens when you go to <em>Control Panel &gt; Administrative Tools &gt; Data Sources (ODBC)<\/em>)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>For some database engines (such as SQL Server) there are 64-bit drivers available (and usually automaticly installed).<br \/>\nTherefor you can develop 64-bit applications for SQL Server, but most other database engines only work with 32-bit drivers.<\/p>\n<p>That&#8217;s pretty much the basic solution to the problem.<\/p>\n<p>If you have any questions, please ask them and I&#8217;ll do my best to help you \ud83d\ude42<\/p>\n<p>&#8211; Dirk<\/p>\n<p>P.S.: Incase you&#8217;re wondering how you have to work with DSN files in .NET, here is a small code snippet to establish a connection using a <em>System DSN<\/em> with ODBC:<\/p>\n<pre name=\"code\" class=\"vb.net\">Dim oCon As New System.Data.Odbc.OdbcConnection(\"DSN=myDSN\")<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hello everyone, If you&#8217;re running a x64 variant of Windows, you might bump into the following problem whilst developing programs that work with databases: You can&#8217;t seem to establish a connection to the database. This usually means that there aren&#8217; t 64-bit drivers available for the database engine you&#8217;re using (For example, MS Access) The &hellip; <a href=\"https:\/\/dirk.schuermans.me\/?p=319\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Database connections on 64-bit systems<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[38,6],"tags":[],"_links":{"self":[{"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/posts\/319"}],"collection":[{"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=319"}],"version-history":[{"count":3,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":781,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/posts\/319\/revisions\/781"}],"wp:attachment":[{"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}