views:

29

answers:

1

Hi guys Is there a way I can run regsvr32.exe to register a dll using VBA? My software is in access (dont blame me, blame the company).

Access for some reason always references the old version of the DAO library. After about 2 hours of searching the internet, someone suggested registering the library, and viola it worked. It cut down my time from 2 minutes (copying a recordset cell by cell) to about 1 second.

so 1) How can I call regsvr32.exe using VBA?

2) Does this utility exist in vista and 7? company is using XP right now, but there tech services are piloting win 7 and hopefully deploy it on all the computers by end of the year. My application can not stop working!

+1  A: 

What version of DAO do you currently have as a reference in your Access database file?

If Access is referencing an older version of DAO then it sounds like an install routine is erronously installing it. Especially if it's DAO 3.6 as that comes as part of the Windows 2000 OS and newer. DAO 3.5 and 3.6 shuold only be found in C:\Program Files\Common Files\Microsoft Shared\DAO. If anywhere else that's wrong.

You can run the shell command to register the DAO DLL.

shell("regsvr32 ""C:\Program Files\Common Files\Microsoft Shared\DAO\dao360.dll""")

If you are working with languages other than English you will need to use the CSIDL routine to find the language specific version of "Program Files".

I don't recall if regsvr32 requires admin privileges. That's certainly possible.

Tony Toews
@Tony Toews Hi this is the only way I have of contacting you. I feel that the vba tag should be kept and that access-vba should be an additional tag. Vba is a general tag and useful for searching, furthermore, quite a bit of vba can be used across all Office applications.
Remou
Good point. BTW the first two or four websites found when searching on my name belong to me and there's contact links on those pages. Hmm, I thought I had added an access-vba tag.
Tony Toews
Well, you can also click on your name to get your SO profile, and what do you know, but your website is listed there, and at the bottom of the first page, a way to contact you via email is listed there! How incredibly unusual!
David-W-Fenton