Showing posts with label Access. Show all posts
Showing posts with label Access. Show all posts

Wednesday, September 14, 2011

Access 2007 Macro Fun

Okay, don't ask me how or why, but an issue with the Access 2007 Transfer Text macro came accross my desk. Macros... I thought these things would die out and go away, but apparently they are holding steady, if not increasing in popularity. But when macros break or don't work, who gets to fix them???? Developers... Developers, who would much rather be writing code and trying to figure out how to work the latest new design pattern into their current project. I digress....

Anyway, here are some tips for all you macrophiles wishing to use this particular macro.
  • Use UNC paths
  • Make sure the file you're importing is allowed by Access.
    • The allowed extensions are: txt, csv, tab, asc, tmp, htm, html, but if you are so insistent that you need to allow some other extension, you can hack the registry using this MS article: http://support.microsoft.com/kb/306144. Please note that if you are using a 64 bit OS with 32 bit Office, you may need to also look in the HKLM\Software\Wow6432Node\ for the setting.
  • Make sure you have enabled macros.
    • This one is kind of a gimmie, but can get overlooked.


  • If you cannot see the macro in the dropdown list, make sure you are showing all macro actions.
    • The Transfer Text macro is not trusted or regarded as "safe" so Access hides it by default (that should tell you macrophiles something right there).
  • Double check your import specification.
So, if you are going to tread into the land of macros, make sure to play by the rules as much as possible. Utilize the microsoft documentation when setting them up, as it is rather thorough. If you run into trouble, retrace your steps, and double check everything. If all else fails and you do need to to go your resident developer, come with your hat in your hand and a shaker of salt (because he or she will probably make you eat it). Offer him or her a pizza, case of Mt. Dew, or 12 pack of their favorite beer for their trouble. After all, they are doing you a favor. :)

Thursday, June 17, 2010

Fun with Heterogeneous Environments

Okay, so I did some work for a client the other day. Nothing really big, just trying to help an MS Access app I developed for them years ago limp along through it's final days/months... who knows. Anyway, some background...

This app was developed back in 2002 or 2003, can't remember anymore and at the time it was developed, the client's machines consisted of a couple different flavors of windows and Office 2000. So naturally, the app was scoped and developed in Access 2000, which was pretty cool because with ART 2000  it could even run on machines that didn't have Office installed. The app is a basic split db with and MDE front end. As they began to use the application, requests for changes in functionality and schema came and went, and things went along swimingly.

Then one day, I get a call reporting that the application does not work on a certain user's computer. When I get on site I find that the environment had changed. This particular user had the latest and greatest OS and version of Office. Suprise!! My install package would no longer work. So I fixed the install and recommended and provided a bid to convert the app into a ASP.NET intranet app. Much more flexible, easier to update, no fuss, no muss... They were not interested, and wanted to leave things the way they were, as they were moving to a new product that was an ASP.NET web app (and more spendy than my bid mind you).

---FAST FORWARD TO TODAY---

So I get a call a few months ago reporting that the client is upgrading to a new file server and would like to move the DB backend, but the front end code was throwing a bug that wouldn't allow it without a lot of complaining. I know, I know... bad developer! BAD!! I apologize for having the short-sightedness that this app would have such a long lifespan.

The request was to get rid of the errors and make it easy for the end users to relink the front end to the backend if it were ever moved again. No problem, that was the easy part. The hard part, was getting an install that would recognize and install the app on mulitple environmental flavors of OS & Office combos -- mmm... combos...  ---- Where was I?? Oh, yeah, so I did my reasearch and got my list of flavors and tried to come up with an install that would do the job w/o my having to sink a bunch of time into it. Got that to a point where I felt fairly good about, so I crossed my fingers and lined up the upgrade.

Upgrade day came and things started out not too bad, but 2 years had passed since the last time I had been out there and things changed quite a bit. Now I know what you're thinking... "My it must have been a pleasant, orderly suprise"... Wrong! It was actually a little worse than what my research had turned up. Multiple versions of Window (XP, Vista, 7) with multiple versions of Office (2k, XP, 2K3, 2K7). As if that was not bad enough, there were a few users who actually changed their drive letter assignments (i.e. C:\ was no longer the system drive). All considered, everything went fairly well, except for the machines with the wierd drive letter assignments.

I will attribute success to two things, using a batch file to open the font end using the generic MSACCESS.EXE <FILE_NAME> command line option (http://support.microsoft.com/kb/209207) and the nuggut of gold that I like to call Access 2000 Runtime. That's right Microsoft may have discontinued it but, ART 2k is awesome and can often save you in a pinch! In the end, with the smoke clearing, the client is happy with a version of the app that they can move around as they see fit so it can be used for historical purposes, and although I may not have anything to do with this app again I'm sure they will contact me other special projects as they come along. Who knows maybe this thing will go another 8 years?!!