--PGP_Universal_720735BF_F9390D73_51C20F59_566E5404 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: QUOTED-PRINTABLE Hi, With Office 2003, I am able to open through ruby an Access database, make a= few structure changes in it, and finally open a report, with code similar = to: require 'win32ole' access =3D WIN32OLE.new('Access.Application') database =3D File.expand_path('<the_msaccess_database_name>) access.OpenCurrentDatabase(database) access.run("<the_msaccess_public_sub_in_vbs>", "param1", "param2") access.DoCmd.OpenReport("the_msaccess_report", 2, "", "") access.Visible =3D true This works fine with both the old Ruby One-Click Installer 1.8.6, and the u= pcoming Ruby Installer 1.8.6 RC2, from Luis Lavena. Unfortunately, things are getting worse with Office 2007. For an unknown re= ason, database is opened *read-only*, and the command access.run("<the_msaccess_public_sub_in_vbs>", "param1", "param2") ... fails, since it tries to modify the structure (a querydef in fact) of a= read-only database. Strangely, this almost similar code rewritten in wsh: Set objAcc =3D WScript.CreateObject("Access.Application") strDBName =3D "<the_msaccess_database_path>" objAcc.OpenCurrentDatabase strDBName objAcc.run "<the_msaccess_public_sub_in_vbs>", ", "param1", "param2" objAcc.DoCmd.OpenReport "the_msaccess_report", 2, "", "" objAcc.Visible =3D true ... works perfectly. Access 2007 database is opened read-write, and scripts= executes fine. I'm not sure who is the culprit here: Ruby/WIN32OLE? Not really, it works f= ine with Office 2003. Office 2007? Hum, maybe, but it works through WSH... Does anyone have an idea maybe? Best regards, ------------------------------------------------------------- Attik System web : http://www.attiksystem.ch Philippe Lang phone: +41 26 422 13 75 rte de la Fonderie 2 gsm : +41 79 351 49 94 1700 Fribourg pgp : http://keyserver.pgp.com=20 --PGP_Universal_720735BF_F9390D73_51C20F59_566E5404 Content-Type: application/pgp-signature; name="PGP.sig" Content-Transfer-Encoding: 7BIT Content-Disposition: attachment; filename="PGP.sig" -----BEGIN PGP SIGNATURE----- Version: 10.0.0 iQEVAwUBS4Zv5VVut9/n/zM8AQhE4ggAnVQCGCYqA9eP6LdL7lLQni7/Th6wGdXj sce9AeK2kD2L6eyEH5QULRTKt4pCIFH9Mecj27FWyx+c6xo1MezSFPPwhIinFhH1 LIya5aaIEmBQhNB5HkSpd4Q8QrbxCL77XHgYjcib04i2S5XrMwrT3Os6vbLUy4cH oG8cqzlTbSg5V40kRNat6RRLv1eluQqGNhEJ/q3oomakcC1W41qGYI7LrMWsDJ9A fZnvVgIyV3wtEnFUeKy4t9ymFCwXg18i/1A9BMGgwhdIeF9Qh5Wi5T/4eTPhSomU HBo6Ij+PekLqhyXgb9dWFUc8+ZwHb7VeGFNIJKe5RA5O9vf2fG5ybg== =RHxK -----END PGP SIGNATURE----- --PGP_Universal_720735BF_F9390D73_51C20F59_566E5404-- Hi, With Office 2003, I am able to open through ruby an Access database, make afew structure changes in it, and finally open a report, with code similar to: require 'win32ole' access = WIN32OLE.new('Access.Application') database = File.expand_path('<the_msaccess_database_name>) access.OpenCurrentDatabase(database) access.run("<the_msaccess_public_sub_in_vbs>", "param1", "param2") access.DoCmd.OpenReport("the_msaccess_report", 2, "", "") access.Visible = true This works fine with both the old Ruby One-Click Installer 1.8.6, and the upcoming Ruby Installer 1.8.6 RC2, from Luis Lavena. Unfortunately, things are getting worse with Office 2007. For an unknown reason, database is opened *read-only*, and the command access.run("<the_msaccess_public_sub_in_vbs>", "param1", "param2") ... fails, since it tries to modify the structure (a querydef in fact) of aread-only database. Strangely, this almost similar code rewritten in wsh: Set objAcc = WScript.CreateObject("Access.Application") strDBName = "<the_msaccess_database_path>" objAcc.OpenCurrentDatabase strDBName objAcc.run "<the_msaccess_public_sub_in_vbs>", ", "param1", "param2" objAcc.DoCmd.OpenReport "the_msaccess_report", 2, "", "" objAcc.Visible = true ... works perfectly. Access 2007 database is opened read-write, and scriptsexecutes fine. I'm not sure who is the culprit here: Ruby/WIN32OLE? Not really, it works fine with Office 2003. Office 2007? Hum, maybe, but it works through WSH... Does anyone have an idea maybe? Best regards, ------------------------------------------------------------- Attik System web : http://www.attiksystem.ch Philippe Lang phone: +41 26 422 13 75 rte de la Fonderie 2 gsm : +41 79 351 49 94 1700 Fribourg pgp : http://keyserver.pgp.com -----BEGIN PGP SIGNATURE----- Version: 10.0.0 iQEVAwUBS4Zv5VVut9/n/zM8AQhE4ggAnVQCGCYqA9eP6LdL7lLQni7/Th6wGdXj sce9AeK2kD2L6eyEH5QULRTKt4pCIFH9Mecj27FWyx+c6xo1MezSFPPwhIinFhH1 LIya5aaIEmBQhNB5HkSpd4Q8QrbxCL77XHgYjcib04i2S5XrMwrT3Os6vbLUy4cH oG8cqzlTbSg5V40kRNat6RRLv1eluQqGNhEJ/q3oomakcC1W41qGYI7LrMWsDJ9A fZnvVgIyV3wtEnFUeKy4t9ymFCwXg18i/1A9BMGgwhdIeF9Qh5Wi5T/4eTPhSomU HBo6Ij+PekLqhyXgb9dWFUc8+ZwHb7VeGFNIJKe5RA5O9vf2fG5ybg== =RHxK -----END PGP SIGNATURE-----