Use Office References and Treeview OCX from File - ms-access

we have an over the years grown Access Database which is making use of a Treeview Element and the Excel Office reference. With some Windows Updates we ran into problems with the Treeview (throws random errors about ActiveX control for each input: mouse move, mouse click, etc.).
Some customers use Access 2003 (we 2007) and therefore some errors are thrown on the first time opening the database because the references have to be adjusted.
I want to solve those problems by taking the office 2003 reference (I think it should be the MSO.dll) and store it in the database as an OLE object. On Startup I want to 'extract' the file and use it as a reference for the office libraries, so that I am kind of independent from the installed Office version on the machine.
Furthermore I thought about doing the same thing with the MSCOMCTL.OCX so that it can not get corrupted from Windows Updates anymore. I hope to gain more stability in the application.
My questions would be: Is it possible at all to use the office references from a local file instead of the windows dir?
And is it possible to use an ActiveX control directly from a local file instead of the registered one through RegSvr32?
If so, any links or information how to achieve this will be greatly appreciated.
Kind regards,
Matthias

I honestly don't know if it's possible, but I certainly would do everything I could to avoid going down that road. The potential for even worse stability problems and general weirdness would be significant. I would push for either
standardizing on an Office version (not 2003), or
using a third-party treeview control from a reputable developer and using late binding to replace the Excel reference(s).

Related

Microsoft CommonDialog Control for higher version of MS Access

I've been searching the web for answers but got no success to find the right thing to do. So this is my last resort.
We have an Access database (1997) and works perfectly in our old remote server. But when we migrated it to Windows 2012 Server and convert it to .accdb file format, the CommonDialog built-in method which opens a window for selecting a file is not working and error message pops up.
By that we are completely aware that some references are missing and we were right.
We searched the web and realized that we need to use the Application.FileDialog under Microsoft Office x.0 Object Library for higher version of MS Access. We implemented that for some of our VBA code that utilizes the CommonDialog and it worked.
But we are also thinking on how are we able to continue using the CommonDialog for higher version of Access just for the sake of not tweaking our VBA code?
If you have an idea about this, I would be glad to hear. Thanks in advance!

MSAccess error with a version of file on pc - OCX

I have an Access 2003 application that users recently started having issues with the day I put out a new version, one of the screens has a field that has a default value of 'date()', instead of showing the date it shows '#name?'. I'm sure this if some out of synch dll or ocx but not sure which one. Anybody know? I rolled back to a previous version of the application on the users machine and they are fine now (but I'll need to keep pushing out new versions with new functionality soon). So I think some file on my development box got updated just not sure which one.
Thanks
Don
This is typical of a missing reference. If your are using ActiveX controls, you could easily be missing something on the other PCs. Another common cause is using early binding and library references.
Missing references often affect the VBA core functions such as Date.

Access 2007 Visual Basic Code Subversioning

Is there a way to version the VBA modules inside an Access 2007 database, or am I just stuck with exporting the code and keeping it separate from the database and maintaining two different copies?
MS Access has a MSSCCI interface which you can connect to any source control system which has a MSSCCI interface. Many of them do. For example for SVN there is AgentSVN or VisualSVN.
Download and install the Access 2007 Developer Extensions, and choose the source code control from your installed SCC providers.
Source control in MS Access uses the Access SaveAsText/LoadFromText methods. All recent versions of Access use a VBA object to hold the VBA modules in, they aren't stored natively in the database anymore, so you can't just export the record holding each module as you used to be able to do.
There are mixed reports about using integrated source control in MS Access. Your milage may vary.
On a historical note, a multi-user, multi-process relational database is ideal for ensuring coherance in source code. According to some reports, the Office 2000 developers were unable to maintain project coherence when using the native database to store modules, and fixed it by using a locked single project object. Possibly missing the fact that Windows 2000 SMB server was corrupting data (fixed in Win2K SP1).
Based on the response so far, I conclude you can't have versioning.
I believe this is because an Access DB code-base is not viewed as a set of modules -- that is, not as interchangeable elements the way code is in many other settings. A truly modular approach increases the requirement for strict control because you must ensure coherence; thus, versioning.
Code in VBA is not handled as agile -- which of course is understandable historically. It's a huge watershed in development approach. So while you benefit from an agile mindset, you won't find it facilitated so well.
NOTE:
In case you're not aware, some key aspects of modular approach are met by separating the app into client and server documents (splitting your database).

Using Microsoft Access in my application

I am writing a C++/MFC application that will use Microsoft Access to store data.
I hope using it will suit my purpose : small, lightweight way to keep application's data.
the question i'm asking myself is : if I use Access as DB, will the client's machine be required to install Microsoft Access to use my software ?
thanks.
Do you simply want to use Access files (*.mdb), or do you want to embed the Access Active Object in your application?
If you just want to use its file format, they just need to install the ODBC drivers, not the entire application.
But if you want to use ActiveX to embed Access UI inside your application, they need to have full Access installed.
Going by the Microsoft Data Access Components page on Wikipedia, it states in the table that from the initial release of Windows 2000, ODBC drivers for Microsoft Access are included by default. In other words, you should be safe to assume that your program should have no problems reading MS Access databases on any Windows PC nowadays.
The problem here is the promiscuous use of "Access" to mean "Jet MDB." If you've got an Access database, it's an Access application, with UI objects (forms/reports/etc.) and to run it you must have Access or the Access runtime installed.
It's pretty clear, though, that you're just using a Jet MDB to store your data, in which case everything you need is already installed on every version of Windows from 2000 on because Jet is installed as part of the OS.
Francis is correct, however you might want to take a look at more robust DB choices. SQLite, SQL Server Compact Edition, or Firebird are all good alternatives to MS Access for simple, light-weight, easy RDBMS needs.
You don't need Access to use a an Access database - you can use ODBC for that. However, if you are also considering XML, I suggest you have not analysed the problem you are trying to solve deeply enough - XML and databases like Access have almost nothing in common.

What are the implications of running a Microsoft access database in both 2003 and 2007?

What are the implications of running a Microsoft Access Database in both 2003 and 2007?
Is there some class I forgot to take?
The program was originally built in office 2003, and then run in 2007. Issues seem to happen when the machine it is being run on has both 2003 and 2007 on it. The issue would also appear to stem from reference from the "Microsoft Access 12.0 Object Library" (or the "Microsoft Access 11.0 Object Library" in 2003). To see this, just look at the Tools: Refrences menu on the VBA screen.
The error's symptom is basically the code not be recognized (almost like it doesn’t recognize the programming language I’m using). It usually follows this with a box that says "The expression On Load you entered as the event property settings produced the following error: Object or class does not support the set of events". You can also replace “On Load” with “On Click” for buttons or “On Change” for text boxes.
I personally suspect that the computer is taking parts of the Microsoft Access 11.0/12.0 Object Library and then mixes the two into a useless VBA reference. What further confirms my suspicion is the box that pops up when going between the two that says "Configuring Microsoft Access" Another issue that further confirms my suspicion is it will run on whichever one it is opened on first (2007, for example) and then not run on the other (2003 continuing the example)
The only other issue is I have had to fix was changing the last part of the DoCmd.OpenForm ,,,,, acFormReadOnly (or acReadOnly, depending on how the machine seems to feel on that particular day - yes it would work with one, one day and then want me to switch it another) to simply locking the individual text boxes
Maybe it’s not quite coding, but I think it might be able to be fixed by coding.
Hopefully that’s enough for someone to come up with something.
Microsoft's official position is that installing multiple office versions on the same pc is not supported and not recommended, and Access 2007 seems to be designed to prove that to us!
That said, you can avoid most issues by doing the following:
1 - Splitting the db into a back end and front end. Place the back end (tables and relationships) in a network folder, and place a copy of the front end (all other objects) on each user's desktop.
2 - It's best to make the front end an mde to avoid the references shuffle every time you open the db in the other version of Access.
3 - Create a shortcut to open the front end with the desired version of Access so it's always opened with that version. (And remember to use the shortcut!) In the shortcut's target:
"path to Access 12 msaccess.exe" "path to db.mdb"
We have an MS-Acces application, developped with Access 2003 and used on either full or runtime version of Access 2003 and Access 2007 (Access 2007 Runtime being free, we are making a great use of it!). There is no particular issue except the references management. Our code analyses the Office version installed on the computer and automatically updates corresponding references (not only Access but also Excel, Outlook, Word, etc.: code is very tricky but of great interest!)
To my own knowledge, no major objects, properties or methods available in Office 2003/VBA were deprecated in Office 2007. Office 2003 code will then run with Access 2007 once these references issues solved. Some new objects were introduced in Office 2007 so I would not advise any developer to use it to develop code to be further used with Access 2003.
But the main & real issue of your question is: why should one run both Access versions on the same computer? This is what I'd do if I want to make sure to crash my apps. I think that if your objectives were to develop software, you should definitely find a better configuration for your machine!
In general, having multiple versions of Access installed on the one machine is unsupported and will result in the issues you are seeing with the object references.
If the database is authored in Access 2003, compiled to an .MDE, and then deployed onto a separate Windows instance running Access 2007, you should not have any significant issues (other than UI changes such as custom toolbars being thrown into the Add-Ins ribbon).
For testing on multiple versions of Access you will need some form of isolation between each version. I use multiple virtual machines to accomplish this. My primary Windows VM runnings Office 2007 and IE7 and I have a second VM which has Office 2003 and IE6 for testing.
Note that if you wish to simply use Word, Excel and Outlook 2007 with Access 2003, you can install Access 2003 first by itself and then do a custom install of Office 2007 and deselect Access 2007.