露从今夜白 發表於 2020-11-13 15:08:00

64位系统下access的64位odbc驱动

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1 align="center">ACCESS使用64位odbc</h1>
<p>&nbsp;</p>
<p>下载orca编辑器地址:</p>
<p>https://www.technipages.com/download-orca-msi-editor</p>
<p>&nbsp;</p>
<p>下载access64位odbc(AccessDatabaseEngine_X64.exe)地址:</p>
<p>http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;displaylang=en</p>
<p>如果直接安装AccessDatabaseEngine_X64.exe时会提示已经安装32位驱动,无法正常安装。</p>
<p>Qt的编译的64位程序无法访问access数据库,只能编译为32位程序访问access数据库。</p>
<p>因为系统office2010一下的版本默认安装的是access32位的odbc驱动程序。</p>
<p>&nbsp;</p>
<p align="left">//odbc数据源定义中路径符号"\"和"/"要换成"\\"</p>
<p align="left">&nbsp;&nbsp;&nbsp; //编译为64为版本(office2010以上版本)"DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};FIL={MS Access};DBQ=c:\\test.accdb;"</p>
<p>//编译为32位可以正常访问(office2010以下版本)QString("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=acs.mdb;");</p>
<p>&nbsp;</p>
<p><strong>可下列办法解决ACCESS</strong><strong>按钻过64</strong><strong>位odbc</strong><strong>驱动程序的问题。</strong></p>
<p>&nbsp;</p>
<p>一、安装orca编辑器</p>
<p>下载orca编辑器地址:</p>
<p>https://www.technipages.com/download-orca-msi-editor</p>
<p>&nbsp;</p>
<p>二、下载access64位odbc(AccessDatabaseEngine_X64.exe)地址:</p>
<p>http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;displaylang=en</p>
<p>&nbsp;</p>
<p>三、解压AccessDatabaseEngine_X64.exe后,用orca编辑器打开AceRedist.msi文件,</p>
<p>选择LaunchCondition项,选择BLOCKINSTALLATION行删除,然后保存,运行AceRedist.msi文件,即可正常安装access的64位odbc驱动。</p>
<p>&nbsp;</p>
<p>&nbsp;<img src="https://img2020.cnblogs.com/blog/340253/202011/340253-20201113150544536-1135450615.png" alt="" loading="lazy"></p>
<p>&nbsp;</p>
<p>&nbsp;<img src="https://img2020.cnblogs.com/blog/340253/202011/340253-20201113150555640-1879494163.png" alt="" loading="lazy"></p>
<p>&nbsp;</p>
<p>&nbsp;<img src="https://img2020.cnblogs.com/blog/340253/202011/340253-20201113150611693-1079578782.png" alt="" loading="lazy"></p>
<p>&nbsp;</p>
<p>&nbsp;<img src="https://img2020.cnblogs.com/blog/340253/202011/340253-20201113150627055-1410660734.png" alt="" loading="lazy"></p>
<p>&nbsp;</p>
<p>&nbsp;<img src="https://img2020.cnblogs.com/blog/340253/202011/340253-20201113150640336-1742089123.png" alt="" loading="lazy">&nbsp;</p>
<p>&nbsp;</p>
<p>四、安装完成后,在控制面板—管理工具—odbc64位数据源驱动中可以看到access驱动,表示安装成功。</p>
<p>&nbsp;</p>
<p>&nbsp;<img src="https://img2020.cnblogs.com/blog/340253/202011/340253-20201113150653012-1339509274.png" alt="" loading="lazy"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1>qt access 数据库</h1>
<p>下列内容来自于:https://www.cnblogs.com/lvdongjie/p/11780618.htm</p>
<p>#include &lt;QCoreApplication&gt;</p>
<pre>#include &lt;QSqlDatabase&gt;</pre>
<pre>#include &lt;QSqlQuery&gt;</pre>
<pre>#include &lt;QtDebug&gt;</pre>
<pre>#include &lt;QSqlError&gt;</pre>
<pre>int main(int argc, char *argv[])</pre>
<pre>{</pre>
<pre>&nbsp;&nbsp;&nbsp; QCoreApplication a(argc, argv);</pre>
<pre>//&nbsp;&nbsp;&nbsp; QSqlDatabase db;</pre>
<pre>//&nbsp;&nbsp;&nbsp; db = QSqlDatabase::addDatabase("QODBC","test");</pre>
<pre>//&nbsp;&nbsp;&nbsp; db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};FIL={MS Access};DBQ=E:/test.mdb");</pre>
<pre>//&nbsp;&nbsp;&nbsp; if (db.open()) {</pre>
<pre>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qDebug() &lt;&lt; "xxxxxxxxxxxxxxxx";</pre>
<pre>//&nbsp;&nbsp;&nbsp; }</pre>
<pre>//&nbsp;&nbsp;&nbsp; else {</pre>
<pre>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qDebug() &lt;&lt; db.lastError();</pre>
<pre>//&nbsp;&nbsp;&nbsp; }</pre>
<pre>//&nbsp;&nbsp;&nbsp; return a.exec();\&nbsp; QCoreApplication a(argc, argv);</pre>
<pre>&nbsp;&nbsp;&nbsp; QSqlDatabase db;</pre>
<pre>&nbsp;&nbsp;&nbsp; db = QSqlDatabase::addDatabase("QODBC","test");</pre>
<pre>&nbsp;&nbsp;&nbsp; db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};FIL={MS Access};DBQ=testacc64");</pre>
<pre>&nbsp;&nbsp;&nbsp; if (db.open()) {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qDebug() &lt;&lt; "xxxxxxxxxxxxxxxx";</pre>
<pre>&nbsp;&nbsp;&nbsp; }</pre>
<pre>&nbsp;&nbsp;&nbsp; else {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qDebug() &lt;&lt; db.lastError();</pre>
<pre>&nbsp;&nbsp;&nbsp; }</pre>
<pre>&nbsp;&nbsp;&nbsp; return a.exec();</pre>
<pre>}</pre>
<pre>int createSQLServerConnection()</pre>
<pre>{</pre>
<pre>&nbsp;&nbsp;&nbsp; loadPlugin();</pre>
<pre>&nbsp;&nbsp;&nbsp; QString strHost = "10.211.55.4";</pre>
<pre>&nbsp;&nbsp;&nbsp; int port = 3306;</pre>
<pre>&nbsp;&nbsp;&nbsp; QString strDbName = "SQLData";</pre>
<pre>&nbsp;&nbsp;&nbsp; QString strUserName = "test";</pre>
<pre>&nbsp;&nbsp;&nbsp; QString strUserPwd = "123321";</pre>
<pre>&nbsp;&nbsp;&nbsp; QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");</pre>
<pre>&nbsp;&nbsp;&nbsp; QString strconn = QString("Driver={sql server};SERVER=%1;PORT=%2;DATABASE=%3;UID=%4;PWD=%5;")</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .arg(strHost)</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .arg(port)</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .arg(strDbName)</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.arg(strUserName)</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .arg(strUserPwd);</pre>
<pre>&nbsp;&nbsp;&nbsp; db.setDatabaseName(strconn);</pre>
<pre>&nbsp;&nbsp;&nbsp; if (!db.open())</pre>
<pre>&nbsp;&nbsp;&nbsp; {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qDebug() &lt;&lt;"error_SqlServer:" &lt;&lt; db.lastError().text();</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 1201;</pre>
<pre>&nbsp;&nbsp;&nbsp; }</pre>
<pre>&nbsp;&nbsp;&nbsp; return 0;</pre>
<pre>}</pre>
<pre>access </pre>
<pre>"Driver={microsoft access driver(*.mdb)};dbq=*.mdb;uid=admin;pwd=pass;"</pre>
<pre>dBase</pre>
<pre> "Driver={microsoft dbase driver(*.dbf)};driverid=277;dbq=***;"</pre>
<pre>oracle </pre>
<pre>"Driver={microsoft odbc for oracle};server=oraclesever.world;uid=admin;pwd=pass;"</pre>
<pre>MSSQL server </pre>
<pre>"Driver={sql server};server=servername;database=dbname;uid=sa;pwd=pass;"</pre>
<pre>MS text </pre>
<pre>"Driver={microsoft text driver(*.txt; *.csv)};dbq=**;extensions=asc,csv,tab,txt;Persist SecurityInfo=false;"</pre>
<pre>Visual Foxpro</pre>
<pre> "Driver={microsoft Visual Foxpro driver};sourcetype=DBC;sourceDB=*.dbc;Exclusive=No;"</pre>
<pre>MySQL </pre>
<pre>"Driver={mysql};database=yourdatabase;uid=username;pwd=yourpassword;option=16386;"</pre>
<pre>SQLite </pre>
<pre>"Driver={SQLite3 ODBC Driver};Database=D:\SQLite\*.db"</pre>
<pre>PostgreSQL </pre>
<pre>"Driver={PostgreSQL ANSI};server=127.0.0.1;uid=admin;pwd=pass;database=databaseName"</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1>64位系统安装ODBC驱动的方法</h1>
<p>来自于:https://blog.csdn.net/dongqinglove/article/details/9175863</p>
<p>&nbsp;</p>
<p>dongqinglove&nbsp;2013-06-26 09:58:57&nbsp;&nbsp;2207&nbsp;&nbsp;收藏&nbsp;1</p>
<p>分类专栏:&nbsp;c#基础知识</p>
<p>&nbsp;</p>
<p>为了更充分的利用硬件资源,我想很多人都开使用64位操作系统了,同时你可以也发现了在64位操作系统上ODBC的驱动找不到了,所以ODBC的东西都没法用了。 因为2007以前版本的Office只有32位版本,所以我们不能在64位系统上使用ODBC。使用Autodesk 64位产品的用户,包括64位的MapGuide Enterpr和 Map3D,肯定也正为这个问题深感苦恼。一个好消息是Office 2010 有了64位版本,同时微软也发布了64为的ODBC驱动程序,这个驱动可以从下面的地址下载:</p>
<p>&nbsp;</p>
<p>http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;displaylang=en</p>
<p>多少情况下我们的机器上可能都已经安装了Office 2007等32位的Office,下载AccessDatabaseEngine_X64.exe安装时多半会碰到下面的错误信息,从而无法继续。</p>
<p>&nbsp;</p>
<p>莫非我真的只有升级到Office 2010 64位版一条路可以走了么?可是貌似微软都建议我们用32位的而不是64位的,我可不想就为这一个ODBC去升级惹麻烦。下面是Microsoft关于是用Office 32还是64的回答。</p>
<p>Yes, 64-bit Office 2010 product upgrades will be available. However we strongly recommend most users install 32-bit version of Office 2010 on both 32 and 64-bit Operating Systems because currently many common add-ins for Office will not function in the 64-bit edition. The 64-bit installation of Microsoft Office 2010 products will be available for users who commonly use<em>very</em>large documents or data set and need Excel 2010 programs to access greater than 2GB of memory. There may be technical issues with the 64-bit version and in order to install a 64-bit version of Office 2010 product users must have a 64-bit supported operating system on their PC.</p>
<p>http://office2010.microsoft.com/en-us/tech-guarantee/microsoft-office-2010-technology-guarantee-faq-HA101812304.aspx?redir=0</p>
<p>所以应该找个办法能在安装了32位Office的机器上安装这个64位的ODBC驱动。下面是更改方法:</p>
<p>先用7zip把AccessDatabaseEngine_X64.exe接压缩,里面会有一个AceRedist.msi安装文件,然后用Orca(下载地址http://www.technipages.com/wp-content/uploads/2007/11/orca.Msi)打开这个MSI,找到LaunchCondition里面的BLOCKINSTALLATION,删掉,保存。现在在运行AceRedist.msi,哈哈,非常顺利。经过我的测试,使用上也完全没问题。</p>
<p>&nbsp;</p><br><br>
来源:https://www.cnblogs.com/qingzhen/p/13969426.html
頁: [1]
查看完整版本: 64位系统下access的64位odbc驱动