September 2009 - Posts

A new version of the Auto FE Updater is available – 1.79

  • Added ShortCutComment to INI file for the user to see when hovering over a shortcut.
  • Fixed bug where if creating both a Program Files shortcut with a folder and a desktop shortcut the utility would attempt to add the shortcut to a folder to the desktop
    - Thanks to Noel Mann of New Zealand for the ShortCutComment suggestion and the above bug report
  • Utility will now correct shortcut icon where the user has updated that field or the admin wants to change them.
  • Fixed various minor bugs and created better error messages mostly in the area of shortcut handling

Visit the Auto Fe Updater site to download or click here.

Posted by Tony | 1 comment(s)
Filed under:

Website Updates - Microsoft Access Email FAQ - CDO aka CDONTS

Added the following to the Microsoft Access Email FAQ - CDO aka CDONTS web page.

Collaboration Data Objects, version 1.2.1
Beginning in Exchange Server 2007 and Outlook 2007, CDO 1.2.1 will no longer be provided as a part of the install of the product. As a result, there is functionality missing that many applications depend upon. CDO 1.2.1 is a package providing access to Outlook-compatible objects through a COM-based API.

Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1
Starting with Exchange 2007, neither the Messaging API (MAPI) client libraries nor CDO 1.2.1 are provided as a part of the base product installation. As a result, there is functionality missing that many applications depend on. Microsoft Exchange MAPI and CDO 1.2.1 provide access to these APIs

Posted by Tony | 4 comment(s)

InStrRev

I’ll be darned.  I had no idea InStrRev existed in VBA code.  It is new in Access 2000 so it’s been around for nine years. 

I had to build this function myself in A2.0 or A97 to get the file name from a string which had the path and file.   The code needed to find the right most occurrence of “\” back slash.  I’ve been happily using my function ever since.  

I actually learned something new about Access this year.  <smile>

Posted by Tony | 1 comment(s)
Filed under: , ,

Queries and the 3061 "Too few parameters. Expected 1." message

Your query is working just fine referencing a form to select some records:

QueryFormParm

but when you run it in code you get the dreaded 3061 "Too few parameters. Expected 1." message.

One option is to evaluate the Forms![Form name]![Field Name] expression as per the following examples.

The below example is an execute query.

Set db = CurrentDb
Set qdf = db.QueryDefs("LEMBatchesRpt Append to temp table")
For i = 0 To qdf.Parameters.Count - 1
    qdf.Parameters(i) = Eval(qdf.Parameters(i).Name)
Next i

qdf.Execute dbFailOnError

The below example is used in my standard routine which copies the contents of a recordset into an Excel spreadsheet.  Due to the requirements of basing the openrecordset on a query to which I added a Where clause I created a temporary query and then did the parameter evaluation

strSQL = "SELECT * FROM [" & strQuery & "]"
If Len(strWhere) > 0 Then _
    strSQL = strSQL & " WHERE " & strWhere & ";"
Set qdf = db.CreateQueryDef("", strSQL)
For i = 0 To qdf.Parameters.Count - 1
    qdf.Parameters(i) = Eval(qdf.Parameters(i).Name)
Next i
Set rs = qdf.OpenRecordset(dbOpenSnapshot)

….

' Insert recordset into cells starting at left hand side and second row
'  Using a copyfromRecordset is much, much faster than stuffing in the cells one at a time.
.range("A2").CopyFromRecordset rs

This is used in a generic routine behind the very flexible reporting form in the Granite Fleet Manager.  When the user clicks on the Export Report to Excel command button I look at the record source of the report to fetch the query name.   I then build the where clause and execute the above code.

Posted by Tony | 2 comment(s)
Filed under: , ,

New version of the Auto FE Updater available

  • Added ProgramsMenuFolder option to create a folder in your Start >> All Programs menu for such shortcuts.
  • Added buttons to open the server folder or the Main App Folder in Windows Explorer.  If the user gets an error message they only see the button to open the Main App Folder.
  • Fixed bug where StartMDB.exe was staying in memory introduced in version 1.77
  • Changed StartMethod=FileExtension to use a different API call as the API call I chose to use did not handle file extensions longer than 3 characters consistently including ACCDB and ACCDE.
  • Remove Startmethod=FileExtensionSimple as it is now the same as StartMethod=FileExtension
  • Documented NewINIPathAndFile in the INI pages and updated the FAQ page.  "This line is only used when moving servers or such as this will rewrite the path and name of the StartMDB exe and INI file in the target of the shortcut.   This line is only placed in the old INI file."
  • Minor bug fixes, and some better error handling and clearer error messages in a few places.

Visit http://www.autofeupdater.com/download.htm to download

Posted by Tony | 2 comment(s)
Filed under:

Auto FE Updater - "The publisher could not be verified. Are you sure you want to run this software?" message

I came across a posting that explained how to remove this message on an Intranet for a domain.   Note that I’m not a security expert.  Until I get a digital certificate you’re going to have to persuade your IT department.

"Open File - Security Warning: The publisher could not be verified.  Are you sure you want to run this software?"

Posted by Tony | with no comments
Filed under:

FindExecutable API call fails for ACCDB file extensions

The API call "FindExecutable: Find Exe Associated with a Registered Extension" fails on a file with the ACCDB extension.   The API call does work fine with the MDB extension.   Clicking on an ACCDB file in Windows Explorer does work.  This is a on a new, fresh Win XP/Access 2007 install with nothing else on the system and no uninstalls, etc.

This has been confirmed by folks over in the microsoft.public.vb.general.discussion newsgroup. 
Microsoft Communities - FindExecutable API call fails for ACCDB file extensions
Google Groups - FindExecutable API call fails for ACCDB file extensions

Note Mike Williams statement:  "There were all sorts of strange anomalies where certain file extensions were found by FindExecutable and other file extensions were not, with (up to now) no apparent rhyme or reason behind it. "

Irony/Stupidity/Blind spot

That said ShellExecute will do what I want.  I had a blind spot and forgot you could send it parameters.  So I’ve spent several hours getting this API call working, or so I thought until someone hit this bug, for nothing.  <sigh> Worse, I could’ve added some requested functionality to the Auto FE Updater a long time ago.  <bigger sigh>

I will be issuing a new release of the Auto FE Updater in the next few days after I fix up a few other minor bugs.

Posted by Tony | with no comments
Filed under: , ,

A new version of the Auto FE Updater is available

A new version of the Auto FE Updater is available at my new, somewhat reorganized website http://www.autofeupdater.com/

Added FileExtension and FileExtensionSimple to the StartMethod.   This now means the utility can be used for ADP/ADEs or any other file extension really.  This method can be easier for the developer for testing purposes than AutoSelect if  the developer is using Access 2003 on their system and has Access 2007 installed as the AutoSelect starts the newest version of Access.  Thus causing the annoying wait while Access 2007 installs itself.

Added a debug checkbox to the developers form so you can see what the Auto FE Updater wants to do before you run the utility

Updated website showing the CreateShortCutOnPrograms and CreateShortCutOnCommonPrograms options which have been available for some considerable length of time but weren't documented on the website.  Oops.

Posted by Tony | 1 comment(s)
Filed under: ,