Connection to the MS Access datebase


How can I connect to the MS Access datebase in ruby/sketchup.
I work on win 8.1 64bit and Sketchup 15 64bit to.

I have script which works properly on XP/Sketchup 14 but dosn,t want work in 64bit enviroment



I guess you are using a to ‘bridge’ Ruby into the MS app ?
Like ?
You need a test in your code Sketchup.version.to_i > 13
if so just require ‘’ - as they are now built-in to the newer Ruby set.
if not require ''
Note that to be cross platform compatible, you should put your own in a subfolder so it is NOT found during the require
If it’s a custom .so you probably need a version compiled for 64 bit ?


Can you provide some more info?
Sounds like you are using binary Ruby C/C++ extensions that needs to be built for 64bit.


The script which worked is:

require 'win32ole'
		base_path = 'D:\ANNA_SZAFY_SKECHUP\anna_szafy.mdb'
		connection ='ADODB.Connection')
		if   File.exist?(base_path) then
							Data Source=#{ base_path }")


And what is the error you are getting now?


Done. Ruby says: (in OLE method ‘Open’: )
OLE error code:800A0E7A in ADODB.Connection
Nie można odnaleźć dostawcy. Może on być niepoprawnie zainstalowany.
HRESULT error code:0x80020009
Wyst¹pi³ wyj¹tek.

Do you need translate into english?


Yes, a translation would be good.


Nie można odnaleźć dostawcy. Może on być niepoprawnie zainstalowany.
Can not find supplier. It may be not properly installed.

Wyst¹pi³ wyj¹tek.
An exception occurred


Try running it in v2015 - but with the “” you have manually added temporarily removed from the v2015 Plugins folder.
Then the native “” in the Ruy might be loaded with your “require”…
You might need to add the “.so” onto the end of the file name in your “require” example ?


Unfortunatly doesn’t work. I didn’t have Plugin folder and I added it. I loaded to this folder file I changed name file after require to “” And still doesn’t work. Mayby is some wrong in “require”. How can I check if is loaded into skcript properly?


Wait - you didn’t have a SketchUp Plugins folder? Are you sure you looked in the correct location? The folder moved in SU2014 for Windows to a new location:

And where did you obtain this win32ole?
As of SU2014 SketchUp ships with the Ruby Standard Library, and that should include win32ole. But not that it’s not located in the Plugins folder because it’s part of the SketchUp application.


Ok.I checked Plugins Folder, and it is in right place. I found in instalation of Ruby. I use SU2015 and when I write
connection =‘ADODB.Connection’)

without require
Done. Ruby says: uninitialized constant AS_RubyEditor::RubyEditor::WIN32OLE

with require ‘’ or require ‘win32ole’

Done. Ruby says: Nil result (no result returned or run failed)


Here is what I get - plain install of SketchUp:

require 'win32ole'

connection ='ADODB.Connection')

base_path = 'D:\ANNA_SZAFY_SKECHUP\anna_szafy.mdb'

connection.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=#{ base_path }")
Error: #<WIN32OLERuntimeError: (in OLE method `Open': )
    OLE error code:800A0E7A in ADODB.Connection
      Provider cannot be found. It may not be properly installed.
    HRESULT error code:0x80020009
      Exception occurred.>

Now, I haven’t tried to set up a database provider - so I’m not surprised that I get this error. Have you made sure you have the appropriate DB provider installed?


This is an issue with AS Ruby console editor. Try using sketchup’s Ruby console.


I put require ‘win32ole’ in ruby console
and receive:
Error: 126: Nie mo¿na odnaleŸæ okreœlonego modu³u. - C:/Program Files/SketchUp/SketchUp 2015/Tools/RubyStdLib/
C:/Program Files/SketchUp/SketchUp 2015/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:45:in require' C:/Program Files/SketchUp/SketchUp 2015/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:45:inrequire’

:in `' SketchUp:1:in `eval'

I chacked, file: is in the place C:/Program Files/SketchUp/SketchUp 2015/Tools/RubyStdLib/


Hi guys, you all are very impressive with your knowledge, how hard would it be for trimble to include a simple database link interface for SU?.. just imagine a two wsy link for things like door schedules, facilities management etc, etc…


I know this as an old thread but it is the only one I could find about connecting to an Access database.

Does anyone know if it is possible to connect to an Access database from SketchUp 64 Bit? As SU 2017 is only available in 64 now I was wondering I it’s still possible to connect if a 32 bit version of office is installed.

This code works fine in SU 2016 32 bit but not in any of the 64 bit installs.

require 'WIN32OLE'
connection ='ADODB.Connection')
path = 'C:\Users\Server Computer\Documents\BCC\dbzip.mdb'
connection.Open('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + path)
recordset ='ADODB.Recordset')
sql = 'SELECT TOP 5 * FROM ZipCodes'
recordset.Open(sql, connection)
rows = recordset.GetRows.transpose

Trying this code in SU 2017 64 bit gives the following error:

Error: #<WIN32OLERuntimeError: (in OLE method `Open': )
    OLE error code:800A0E7A in ADODB.Connection
      Provider cannot be found. It may not be properly installed.
    HRESULT error code:0x80020009
      Exception occurred.>

Any input will be appreciated.


What line is giving you that error?

When I try on my machine:

require 'WIN32OLE'
connection ='ADODB.Connection')

I get a different error message with

Error: #<LoadError: 127: The specified procedure could not be found.   - Init_WIN32OLE
C:/Program Files/SketchUp/SketchUp 2017/Tools/RubyStdLib/platform_specific/>
C:/Program Files/SketchUp/SketchUp 2017/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:54:in `require'
C:/Program Files/SketchUp/SketchUp 2017/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:54:in `require'
<main>:1:in `<main>'
SketchUp:1:in `eval'


Might this depend on a given service being installed on the target machine? Which then in turn needs to also be 64bit…?


I’m not sure if the file has a bug in SU 17. I had to copy the one from 2016 to get it to work.