Notes from Daily Encounters with Technology RSS 2.0
 
# Wednesday, April 28, 2010

Query parameters are a very useful Excel feature allowing parameterization of database queries used to import data in Excel. They are really simple to use as well. On the Definition tab of the Connection Properties dialog there is a Parameters… button at the bottom. It gets enabled as soon as there is a parameter defined in the Command text – you define it by typing in a question mark (?) instead of a value in the WHERE clause of the query, as seen in the image below.

 Connection Propertie dialog

Unfortunately there is a limitation for using this functionality which turns out pretty unintuitive in Excel 2007. It is only supported for Microsoft Query based queries. For all other types of queries available in Excel you get the error “No value given for one or more parameters.” when you add a parameter to the Command text. Since the error doesn’t even hint at the real cause of the problem it took me some time before I figured it out. The thing to remember is: If you want to use query parameters, you must select Microsoft Query as the external data source when importing the data for the first time. This can’t be changed at a later time.

Get External Data From Microsof Query

Wednesday, April 28, 2010 8:01:23 PM (Central European Daylight Time, UTC+02:00)  #    Comments [0] - Trackback
Software | Office
# Sunday, August 09, 2009

Microsoft Exchange supports Send As and Send On Behalf Of permissions to be granted to users for individual e-mail addresses. Sending e-mail from Outlook for these users is very simple – they just enter the desired address in the From field of a new message (toggled with the Show From command on the Options ribbon) and if they have the required permission it will be sent accordingly – either as if it was actually sent from that address or as sent by the user on behalf of the address in the From field.

If you want to achieve this from code there is a little more work involved. First of all the user must be authenticated on the server using one of the methods below:

SmtpClient smtp = new SmtpClient("smtp.domain.com");

// use user’s existing credentials
smtp.UseDefaultCredentials = true;

// pass username and password
smtp.Credentials = new NetworkCredentials("username", "password");

The next step is to set up the correct headers in the message otherwise the server will return error code 5.7.1 describing the permission the user does not have.

To send the e-mail as only the From property has to contain the desired address:

MailMessage mail = new MailMessage();
mail.From = new MailAddress("send.as@domain.com");

To send the e-mail on behalf of another user the Sender property must additionally contain the user’s e-mail address:

MailMessage mail = new MailMessage();
mail.From = new MailAddress("send.as@domain.com");
mail.Sender = new MailAddress("user.address@domain.com");

On a related note, the required permissions can be granted using PowerShell.

To grant the Send As permission:

Add-ADPermission –Identity "user1" –User "user2" –ExtendedRights Send-As

To grant the Send On Behalf Of permission:

Set-Mailbox "user1" -GrantSendOnBehalfTo "user2"

In both cases the user1 specifies the mailbox to grant the permission for and the user2 specifies the user to grant the permission to.

Sunday, August 09, 2009 7:39:38 PM (Central European Daylight Time, UTC+02:00)  #    Comments [0] - Trackback
Development | .NET | Software | Exchange
# Saturday, August 01, 2009

Today I decided to get to the bottom of the missing driver issue on my computer running Windows 7 RC. It shows up as PCI Simple Communications controller and it really bugged me since I don't have a modem or a similar device on the motherboard.

PCI Simple Communications ControllerIt turned out that there is a away to identify such a device from the information available in Device Manager. The first step is to open the Properties window for this device and move to the Details tab. After selecting the Hardware Ids in the Property dropdown the device identifiers are displayed.

HardwareIds

The important ones are the numbers written after the VEN and DEV keywords. The first one is the Vendor ID and the second one is the Device ID. So in my case the Vendor ID is 8086 (from VEN_8086) and the Device ID is 29A4 (from DEV_29A4).

All that's left to do know is to go to PCIDatabase.com and enter the ids into the corresponding search boxes. In my case it turned out that it was a device from Intel - Intel Management Engine Interface (HECI). Unfortunately it doesn't have a driver for Windows 7 yet and the Vista one doesn't install. But hey, at least I know which driver is missing.

Saturday, August 01, 2009 7:09:49 PM (Central European Daylight Time, UTC+02:00)  #    Comments [2] - Trackback
Software | Windows
# Saturday, July 05, 2008

Gama System eArchive, one of the two products in our document product line, received accreditation from the Archives of the Republic of Slovenia last week. This acknowledgement by our national body means that any document stored in Gama System eArchive is automatically legally valid.

This is important for both our company and other companies looking for a long term electronic document storage solution. Our product is the first service oriented solution to receive the accreditation.

Congratulations to everyone involved in the product. Well done!

Saturday, July 05, 2008 10:37:14 PM (Central European Daylight Time, UTC+02:00)  #    Comments [1] - Trackback
Development | .NET | Personal | Work
# Sunday, June 15, 2008

Today I've taken my new handeld GPS device for a test run. It did its job pretty well but the real challenge started afterwards when I tried geotagging the photos I've taken. I decided to use Microsoft Pro Photo Tools which have just been released with geotagging as its main feature. Downloading the track data from the GPS device with Garmin MapSource software was quick and simple. But the problems started soon afterwards. MapSource can only export track data in its proprietary format GDB which can't be used in Microsoft Pro Photo Tools.

GPSBabel came to the rescue. This free tool can probably convert files between any two existing GPS formats, at least judging from its list of supported formats. I used it to convert my data to the GPX XML format only to find out that Microsoft Pro Photo Tools have problems with it. Converting to NMEA or KML instead didn't help either. Fortunately the latter returned a strange error (Degrees must be between 0 and 90, found degree 46298501) which put me on the right track. Of course there was no such value in the KML file so I correctly deduced that the decimal separator was to blame.

The value in the file was 46.298501 but the Slovenian regional settings have comma as the decimal separator therefore the value was misinterpreted. Temporarily changing the decimal separator to dot solved the problem - the track was successfully imported immediately afterwards. This issue won't keep me from using this otherwise very useful tool with a really nice feature set. It could even fix the mismatching time settings between my GPS unit and the camera with a single setting. I just hope they address this bug soon so that I won't have to change my regional settings every time I use the program.

The only thing I still have to figure out is why the geotags somehow lost resolution when I uploaded the photos from Picasa to Picasa Web Albums. I just fixed them manually and decided to address the issue next time. Any tips are welcome.

Sunday, June 15, 2008 10:03:01 PM (Central European Daylight Time, UTC+02:00)  #    Comments [0] - Trackback
Software | Imaging
Sponsored Ads

About Me

Damir Arh

Microsoft Certified Professional

View Damir Arh's profile on LinkedIn

Profile for ExAmigan

ExAmigan

Twitter
VS File Explorer looks interesting. I have to give it a try. http://digs.by/9Awmbv 5 hours ago
Potepanja v naravi: Pokljuška soteska http://goo.gl/fb/LeHx9 23 hours ago
Is hosting a preview handler in your own app still an unsupported scenario? http://digs.by/cdY3Ul 1 day ago
RT @MladenPrajdic: RT @danmartell: Top Five Regrets of the Dying http://bit.ly/b8Qywr #MustRead #Friends 2 days ago
On my way to Celje today I've seen parhelion (sundog) for the first time http://imgur.com/NssST http://digs.by/dm1TUQ 6 days ago
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

All Content © 2010, Damir Arh, M. Sc. Send mail to the author(s) - Privacy Policy - Sign In
Based on DasBlog theme 'Business' created by Christoph De Baene (delarou)