AccessBlog.net

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Alex
Name:Alex Dybenko

Location:Moscow, Russia

Tuesday, January 29, 2008

How to configure trusted locations

The best description on how to add and configure trusted locations I found at Gunter Avenius site. He also offers a executable, which you can run with command-line parameters in order to add trusted location to registry. This small program can be also used for application setup with Package and Deployment Wizard.

 

Technorati tags: ,

Friday, January 25, 2008

How to recognize what form's element you click in datasheet view

I like using datasheets as subforms, but Access does not offer datasheet-specific events and properties to automate it. Here 2 cool samples from Krzysztof Naworyta and Krzysztof Pozorek, Access MVPs from Poland, which help to make datasheet more friendly.

How to recognize what form's element you click in datasheet view: column, record selector and so on

New events in datasheet view and Which column I’ve just clicked

Both samples in Polish, but VBA still in English.

Labels:

Thursday, January 24, 2008

Printing PDF from code

Normally you can print document using ShellExecute API with Print parameter. This also works for PDF, but leaves Acrobat Reader open. Imagine what can you get on a screen after multiple document printing? But fortunately - there is a way to close it after print, using old technology - DDE (remember this one? It was the only way to communicate with external program before OLE Automation). Here a procedure to print PDF files from VBA code. Originally I found some parts this code on internet, but can't find source anymore. So if you saw parts of it somewhere - please let me know, I will put a link and reference message.

Now I am posting VBA code in separate HTML pages on PointLtd site, after several tries to find a good way to post code here this way looks more attractive for me, and hopefully for readers also.

 

Technorati tags:

Tuesday, January 08, 2008

Do you really need to save settings at HKLM?

In Windows 95 time I often used HKEY_LOCAL_MACHINE registry hive to store user data, for example path to backend, user settings. Security was at low level, user management was not really used, user could easy create a new account just logging first time on the PC. And the only permanent storage for data was HKEY_LOCAL_MACHINE. But not now!

Security getting stronger, and with Windows Vista you are not allowed to write to HKEY_LOCAL_MACHINE hive even you are administrator (unless you disable UAC)! The only good place to store user data – is HKEY_CURRENT_USER registry hive. But, as I recently read in newsgroups – developers are still trying to use HKEY_LOCAL_MACHINE. And now it could be dangerous!

Imagine we have Access application with linked tables, and we store path to BE in HKEY_LOCAL_MACHINE (using some dirty hacks). When user gets new FE version and first run it – we read saved path and relink new FE to it. Looks ok? But then network administrator decided to install Active Directory security with roaming user profiles stored on server. And here we get a problem – user could easy use any PC to log in, but he don’t know that last user, logged into that PC, have connected to different BE! And he starts to delete data from real database instead of a test copy, or type new data into archive database. whatever. We are in trouble!

One more dilemma – where to install FE? In corporate environment, terminal services and Window Vista users are not allowed to write to C:\Program Files, so they can’t update FE version using VersionCheck or any other similar program. I think that <$USER>\Local Settings\Application Data folder could be a good place to save FE – VersionCheck will deliver new version to this folder when user start application.

Do you have other suggestions?

 

Technorati tags: ,

Friday, January 04, 2008

Update on "convert to PDF" staff

One more great program – PDFCreator, you can use it as PDF printer, but also you can use it automation object to manipulate PDF documents content – search, copy/paste, split, merge, etc. Imagine you need to create an electronic document package – Access report, Word document and Excel sheet printout in single file - PDFCreator can easy do it.

 

Technorati tags: ,