Monthly Archives: November 2008

A Training Issue

A Training Issue   <chuckle>  Folks much younger than me won’t necessarily get this one as they’ve never seen punched cards.

I recall a client nearly thirty years ago telling me how they’d lose data if the tapes snapped.  They’d splice the tapes back together but would be missing a block or two of data.

Standard NotInList VBA code

I finally got around to creating a Using NotInList in a combo box page at my website.   I keep forgetting to make up same sample code and re use it as I don’t care for the MS sample code in the Access help.  A bit too verbose and it doesn’t show how to deal with adding records to tables and then opening up a form.  So here’s the code I just setup as a sample.  Critique away.

Using pictures on a form and report

The following question was asked in the comp.databases.ms-access newsgroup.

I’d like to add a picture in a report’s detail section where the path to the picture is from a table.

Incredibly easy.  The same code works on a form as well.  Using the Toolbox drop an image control on the reports detail section.   Note that you will have to follow the dialog and actually insert an image.  But then go to the Picture property on the Format tab in the property sheet and delete the actual file.  You will probably want to set the Size Mode from clip to zoom. And rename the control to something meaningful.

Then in the report detail section in the On Print event you want to add the following lines of code

    If <logic if file available to view> Then
        Me.PhotoImage.Picture = PhotoFilePath
    Else
        Me.PhotoImage.Picture = “”
    End If

PhotoFilePath being whatever logic you want to use to figure out the file that you want printed.

You don’t want to do this logic in the Format event as Microsoft has told us, via Stephen Lebans, that using that event can lead to memory leak problems.  Or you can use BMP images.   Which is rather impractical.

The reason for extensive bloating in Access when JPG or other graphic files are permanently embedded in forms or reports is that Access converts those file formats to BMP format.   This made sense back in Access 2.0 days is viewing a JPG file was very slow as it requires lots of CPU cycles.  80386 computers running Windows 3.1 were rather slow at that.  BMP format meant that you basically read the large file directly into the graphics card memory.   In Access 2007 the Access product group have updated that logic so the BMP file format isn’t created any more.

Shameless plug:  I have a number of reports in the Granite Fleet Manager which print a “primary” and a number of “secondary” photo’s for each unit.   See Granite Fleet manager Main Menu a screen shot and Service Order Details (with Photo) for a sample report.

I never knew that – view linked table file path and name

I was in the table view in Access 2003 and accidentally hovered over a linked table.  A tool tip (mouse over tip) displayed itself a second later telling me the backend linked MDB file path and name.

ToolTipLinkedFilePathAndMDB 

Cool!  I never knew that.

I should add that I go to great lengths to ensure a user doesn’t have a problem with linked tables.   When the user opens the app I ensure that all tables have the same linked path and file name.   Just in case.  You never know when something really, really weird could happen when relinking tables.   And I’d hate to have to debug a customers problem where a few tables are pointing to a demo MDB and all the other tables are pointing to their live data table.

Other things I do on start are opening a recordset based on a particular table and check for a particular field in it.  If that fails I assume the BE isn’t linked properly and start up the linking table logic.

Note that I install the Granite Fleet Manager into the users Application Data folder and  sub folder of Granite Fleet Mgr using Inno Setup.  I also install the Demo MDB and the demo graphics files into that same folder.  However the live empty Data.MDB gets installed into My DocumentsGranite Fleet Mgr.

I then check to see if there is a license key file in the users My DocumentsGranite Fleet Mgr folder.  If so I then look to see if there is only one data MDB file in that folder. I inform the user and ask if they want to relink to that table.  If there are two or more data MDBs then I inform them and pop up a relinking form.  This handles the situation where I’ve converted their data from a spreadsheet and emailed the user that MDB and the license key file.

 

DatabaseLocations

Note how the number of Units and Service Orders are displayed in the list box.  I’ve found this to be of great value when working with clients and somehow multiple versions of the BE data MDB are floating about.

Thanks to Jim, a friend and client, who suggested adding the Selected Data File Folder field.  If folks are interested and understand what is all going on then that’s all the better.   That field can be double clicked and Windows Explorer opens to that folder.  The code behind that double click event for the Selected Data File Folder is:

Call RunShellExecute(tt_StripFromLastRight(CurrentDb.Name, “”))

tt_StripFromLastRight is a function which removes the “” and everything to the right leaving just the path.

If nothing found as per the above paragraphs then the linking table logic first examines the current FE path for the Granite Fleet Mgr.INI file. If found I then relink to the BE MDB as specified in that INI file.  This handles the situation where the app has been previously installed on the system and the INI file is pointing to a network file location.

If that file isn’t found then I assume this is the first time the user has ever run the app and link to the demo MDB.

I also display the path and file name of the BE MDB in the About screen.  As well as the current FE MDB/MDE file path and name.  

AppMDBDataMDB

I also put in a double click event on those two fields which the user can then open up Windows Explorer.  Do you really want to tell a user how to use Windows Explorer to navigate to a path that Windows by default hides from the user?  No, I didn’t think you would either.

Still reading?   All this when all I meant to type was the first few paragraphs. <sigh>

New version of the Granite Fleet Manager

Ten year annual maintenance costs report
Email feedback form
Added meaningful error 2114 screen
Minor UI improvements and bug fixes

http://granitefleet.com/

Commissions paid to sales agents.

Open a CSV

PowerShell has great functionality for working with csv files.  They make an excellent way of saving information generated by PowerShell Рfor instance

Get-Process | Export-Csv data.csv -NoTypeInformation

Having created a csv file how can we read it?  It is possible to use Notepad but then the columns are not padded to the same width so the data can appear jumbled.  Ideally we would want to use an application that generated a grid view Рlike excel.

Excel is very easy to use for this

$xl = New-Object -comobject "excel.application"
$xl.WorkBooks.Open("C:ScriptsOfficedata.csv")
$xl.visible = $true

Create an object for the Excel application.  Open the csv file in a workbook and make it visible.

 

Share this post :

 

Technorati Tags: ,,

Superando los límites de la Orientación a Objetos (Parte 3)

Sigo con la transcripción no textual de la charla de Alejandro Reimondo de Smalltalking, dada hace unas semanas en la Universidad Tecnológica Nacional, aquí en Buenos Aires, Argentina. Alejandro comentó algunos trabajos en los que participó, desde los noventa:

Particip√© de un proyecto sobre cine argentino. Fue interesante ayudar durante 2 a√Īos, fue interesante ayudar a investigadores de la historia del cine argentino. En esa √©poca, 1995, no hab√≠a salido Windows 95, no hab√≠a muchos productos multimedia. Se arm√≥ un producto donde todas las fotograf√≠as se vinculaban unas a otras, y los personajes y temas relevantes, ten√≠an su ficha. Fue mantenido y creado por un grupo de investigadores coherramientas que fuimos haciendo. Fue la primera cinemateca en el mundo que tuvo un CD ROM de cine de su pa√≠s.

Pueden encontrar más información sobre el proyecto en

Cine argentino en Cd Roms

Fue creado por la Fundación Cinemateca Argentina, pero no encontré un sitio de esta fundación.

En el 2000, participé del proyecto Halcón de IBM. Es un sistema de tracking de documentación de negocios grandes en Sudamérica. Había sido hecho en Smalltalk y nos tocó hacer una actualización.

Estos proyectos estaban enumerados en el “slide” que present√≥ en ese momento. No mostr√≥ software andando:

No voy a mostrar software. Pero traje algo para que no se aburran escuchandome hablar. En el producto Virtual Fashion, hicimos un enganche de Smalltalk con un engine 3d, de una empresa espa√Īola,  en el 2005, 2006, hicimos el ambiente Smalltalk que se monta en cima del ambiente de 3d de ellos, para dise√Īo de moda virtual. En su tiempo, hubo una competici√≥n entre dise√Īadores, donde los dise√Īadores usaban virtualmente las telas que se estaban presentando en ese momento.

La empresa para la que se hizo este desarrollo es Reyes Inform√°tica:

http://www.reyes-infografica.com/

El producto es Virtual Fashion

http://www.virtual-fashion.com/html/en/

Pueden ver una galería de videos con el producto andando en:

http://virtual-fashion.com/html/en/gallery_video.php

Atlas.TI es de hermene√ļtica, interpretaci√≥n de texto. Si uno quiere interpretar p√°rrafos de la Biblia, y los quiere comparar con p√°rrafos del Cor√°n, lo puede manejar por software. Puede enlazar con otros textos, por ejemplo, documentos y contratos. Atlas.TI expandi√≥ eso para manejar lo multimedial, y ahora maneja Google Earth. Puede vincular el texto al mapa del mundo de hoy. Esa compa√Ī√≠a est√° trabajando m√°s de quince a√Īos, son l√≠deres en el mercado, est√° escrito en Smalltalk, y me ha tocado darles asistencia desde ac√°, Argentina, para ese proyecto.

El producto es el

http://www.atlasti.com/

Pueden encontrar informaci√≥n en espa√Īol en

http://www.atlasti.com/productintro_es.html

donde leemos:

¬ŅQu√© es ATLAS.ti?
Durante una década, ATLAS.ti ha sido el líder del mercado en software profesional QDA (para el Análisis Cualitativo de Datos). ATLAS.ti es utilizado en todo el mundo por instituciones e investigadores líderes. Siempre que se precisa de un análisis profesional de texto y datos multimedia, simplemente no existe alternativa a ATLAS.ti.

Compatibilidad con todos los idiomas
ATLAS.ti puede procesar datos prácticamente en cualquier idioma, utilizando todos los juegos de caracteres disponibles, incluidos japonés, chino, árabe, hebreo y muchos más. No obstante, recuerde que la interfaz del programa se mantiene en inglés*, (independientemente del idioma de su material).

Siguió Alejandro con:

Hace dos anios o 3 vengo participando en un esquema de negocios, para el armado de este tipo de productos, fotoalbumes, con cada foto se hacen estos libros. Dise√Īamos una forma de hacer los libros, mi participaci√≥n mayor es en hacer este tipo de software. Con PhotoShop se puede hacer, pero lo interesante de nuestro producto, es que el producto final se hace con la dedicaci√≥n de 2 horas por cada cliente a atender. Entonces, es un software que tiene que ser much√≠simo m√°s r√°pido y eficiente que PhotoShop. Se usan fotos comunes, y hay un metodo de armado. Tenemos un esquema de negocios para Latinoam√©rica.

La empresa de la que participa Alejandro es

http://www.imaginiasoft.com

Pueden ver algunas características del soft en

ImaginiaSoft, software para fotolibros y regalos con fotos

También mencionó Alejandro otros hitos en la historia de Smalltalk en Argentina:

… hay dos hitos que quiero mencionar, el primero fue la fundaci√≥n de Sugar (Smalltalk User Group de Argentina), en la que particip√© hasta 1999/2000. Luego, me he dedicado a Smalltalking, que busca que seamos protagonistas de un avance en tecnolog√≠a. Si bien tiene v√≠nculo con Smalltalk, no se queda ah√≠, y estamos intentando ir por m√°s.

Alejandro no lleg√≥ a explicar claramente qu√© era eso de “un avance en tecnolog√≠a” que espera. Creo que era parte de la charla, pero no le alcanz√≥ el tiempo para volver al tema.

Queremos ser protagonistas de un avance tecnológica de acá a una década, no hemos visto un avance y hay que buscarlo.

….

Con respecto a Smalltalk, me es inevitable no usarlo, porque es lo que he usado durante 20 a√Īos. Toda referencia la hago con respecto a Smalltalk, no me va a escuchar hablar de otras alternativas, elijo Smalltalk porque lo puedo sustentar.

No qued√≥ claro a qu√© se refer√≠a con “sustentar”. Entiendo que tiene relaci√≥n con lo que publiqu√© hace un tiempo sobre

Self-sustaining Systems, Cola, Pepsi, Coke y Mate

Esta falta de terminar de explicitar algunos puntos, va a ser un tema recurrente en la presentación de Alejandro. Habrá que esperar que publique algo explicando esos puntos.

Enlaces relacionados

Superando los límites de la Orientación a Objetos (Parte 1)
Superando los límites de la Orientación a Objetos (Parte 2)
Mas all√° de objetos

Nos leemos!

Angel “Java” Lopez
http://www.ajlopez.com/
http://twitter.com/ajlopez

Scripting and automation

Is there a difference between scripting and automation.  According to Dan http://blogs.msdn.com/dtjones/archive/2008/11/23/scripting-dba-actions.aspx  the answer is yes.   Scripting means you perform a task programmatically using a scripting language (PowerShell I hope).  Automation means that the script is automatically initiated as a scheduled task or a SQL Server job etc.

A quick search shows a number of definitions for automation:

"The replacement of manual operations by computerized methods."

"The automatic operation or control of equipment, a process, or a system."

"a system in which a workplace or process has been converted to one that replaces or minimizes human labor with mechanical or electronic equipment"

I would argue that there is a spectrum of activity ranging over:

  • perform task manually (GUI or command line)
  • script task
  • run script automatically

Creating 7000 users and mailboxes in ADExchange is something you would do with a script.¬† Would you have that script automatically initiated – I don’t think so. But I would argue that you are still automating that task.¬† The machine is doing the work – quicker and potentially (hopefully) more accurately.

My stance is that scripting is automation and whether you run the script manually or automatically in response to a task you are still automating.

There are some useful guidelines on scripting in the post that are applicable to any language.

 

Share this post :

 

Technorati Tags: ,

Download details: Windows SBS 2003 to 2008 Migration Guide

Download details: Windows SBS 2003 to 2008 Migration Guide

Silverlight Tools Install Woes – Build 9.0.30729.XX …

I encountered the dreaded of “Build 9.0.30729.XX Visual Studio 2008 SP1 must be installed before installation can continue” installation error when installing the Silverlight Tools. Help/About indicated that I had 9.0.30729.1.

After a bit of thrashing around, I accepted that there may be a problem with my SP1 installation and decided to reinstall, painful as the prospect was. This was not an easy conclusion for me to accept because there were no other symptoms of trouble with my Visual Studio installation.

I wanted to report that reinstalling SP1 did in fact clear up the problem Silverlight had. Even though its a very tedious process to reinstall the service pack, you’ll probably need to do it if you get this error – to either solve your problem or rule it out.

This blog post by Jimmy Lewis has a very helpful post on the installation

Recent Comments

Archives

ÔĽŅ