Ruby Issue Tracking System: Issueshttps://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112010-03-10T00:09:26ZRuby Issue Tracking System
Redmine Backport187 - Backport #2947 (Closed): win32ole & MS Access 2007https://bugs.ruby-lang.org/issues/29472010-03-10T00:09:26Zplang (Philippe Lang)philippe.lang@attiksystem.ch
<p>=begin<br>
Hi,</p>
<p>When opening a MS Access database with ruby code like</p>
<hr>
<h2>require 'win32ole'<br>
access = WIN32OLE.new('Access.Application')<br>
database = File.expand_path('db2000.mdb')<br>
access.OpenCurrentDatabase(database, false)<br>
access.DoCmd.OpenReport("rptTest")<br>
access.Visible = true</h2>
<p>... database is opened read-write with MS Access 2000/2003, and <em><strong>read-only</strong></em> with MS Access 2007.</p>
<p>I have made tests under Window 7 with ruby 1.8.6 patchlevel 111 and patchlevel 398.</p>
<p>Database format is not an issue: the same problem happens with a database in 2000 (mdb) or 2007 (accdb) format.</p>
<p>I'm not sure if that's a ruby bug or a MS Access limitation, but vbs code like</p>
<hr>
<h2>Set objAcc = WScript.CreateObject("Access.Application")<br>
strDBName = "C:\Users\Philippe Lang\Desktop\db2000.mdb"<br>
objAcc.OpenCurrentDatabase strDBName<br>
objAcc.run "get_document_lines_store", "1234", "L", "1"<br>
objAcc.DoCmd.OpenReport "rptTest", 2, "", ""<br>
objAcc.Visible = true</h2>
<p>... opens the database read-write, whatever version of MS Access we use.<br>
=end</p>